You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ack, grep, and rg all return a different exit code when there is an error (different from the usual "1" which means "no results"). It would be nice if ag did the same.
I don't know whether this issue was never closed, or whether haven't examined the recent code, but die(), the function utilised for reporting errors in ag and defined in util.c, looks like the following:
The exit(2) at the end returns 2 as the exit code. However, the code returned in main during normal operation (no errors) is
return !opts.match_found;
Essentially, the above returns 1 if no results are found and 0 if results are found.
I'm not sure whether you would like to distinguish between specific errors or whether you just wanted to know whether an error occurred during operation via the exit status. I personally don't know the internals of ag very well, but as far as I can tell, die() is used for reporting all errors and exiting when an error occurs. Unless there are certain places where this doesn't occur, I think your issue has been solved.
ack
,grep
, andrg
all return a different exit code when there is an error (different from the usual "1" which means "no results"). It would be nice ifag
did the same.Related
rg
issue: BurntSushi/ripgrep#948The text was updated successfully, but these errors were encountered: