-
Notifications
You must be signed in to change notification settings - Fork 27
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
Allow help
to exit with status other than 1
#80
Comments
Are there any workaround until this is added to cmd-ts? Catching and detecting the help error and changing Also, I'm curious, why was it implemented this way? I've done some testing, and most CLIs exit with code 0 when you run Here are a few commands I tested, all exit with code 0:
|
Looks like this is the line that needs to be changed: Line 35 in e675907
You can see that -h, --help exits with code 1 while -v, --version exits with code 0:Lines 33 to 39 in e675907
|
I think this is an important detail. I believe the most useful and most common convention is:
This is particularly useful for testing that a program is installed correctly, for example to test in a Homebrew formula. |
I would like to be able to exit with status 0 when specifying
-h
or--help
, but it appears that1
is hard-coded as the exit status. Perhaps providing a means for specifying a different exit status when help is invoked would be nice.The text was updated successfully, but these errors were encountered: