Skip to content

Commit a471a87

Browse files
committed
(GH-1724) search - exit 2 on no results
Preserve 1 and -1 for errors. No results should have something more deterministic, and 2 would provide that.
1 parent 606e855 commit a471a87

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/chocolatey/infrastructure.app/commands/ChocolateyListCommand.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -204,10 +204,10 @@ public virtual void run(ChocolateyConfiguration configuration)
204204
// note: you must leave the .ToList() here or else the method won't be evaluated!
205205
var packageResults = _packageService.list_run(configuration).ToList();
206206

207-
// if there are no results, exit with a 1.
207+
// if there are no results, exit with a 2.
208208
if (configuration.Features.UseEnhancedExitCodes && packageResults.Count == 0 && Environment.ExitCode == 0)
209209
{
210-
Environment.ExitCode = 1;
210+
Environment.ExitCode = 2;
211211
}
212212
}
213213

0 commit comments

Comments
 (0)