-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
use different exit codes for "no match" and "error" #948
Comments
This is intended behavior. ripgrep continues this very long held tradition from grep, and I don't see myself changing it or providing a flag to change it. One place where ripgrep could probably use some improvement is in refining its exit codes. Namely, I think ripgrep only ever produces |
Thanks for the quick feedback. Your solution wrt extending the breadth of exit codes sounds great. 👍 |
Interestingly, it looks like this might be border-line trivial to fix. This is ripgrep's current Lines 56 to 66 in 15fa77c
I think all that needs to happen is to change the error case to There is still the matter of writing a test and updating/adding relevant docs, which might be a bit more work since I can't remember if the test harness tries to control the exit status, but either way, shouldn't be too bad. I can patch this myself when I get a chance, but this does seem like an easy task that anyone could take on if they wanted to! |
What version of ripgrep are you using?
0.8.1
How did you install ripgrep?
Homebrew
What operating system are you using ripgrep on?
macOS 10.13.5
Describe your question, feature request, or bug.
Hi!
I am using ripgrep from within a node.js program using
child_process.exec()
. I've noticed that when I don't find anyhting in a search, ripgrep terminates with a non-zero exit code thus informingchild_process.exec()
that "something went wrong".I'd simply like to know, if there is any flag one can use or other measure to prevent a non-zero exit code during the aforementioned circumstances. I can solve the issue from with the node.js program, but would think "manipulating" the exit code would be a more elegant solution.
The text was updated successfully, but these errors were encountered: