-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
imp: Add exitcode::USAGE exit code as suggested in #1327 #1637
imp: Add exitcode::USAGE exit code as suggested in #1327 #1637
Conversation
The reason to do this is described well in issue clap-rs#1327. It is also a recommendation of the Rust book itself: https://rust-cli.github.io/book/in-depth/exit-code.html
Thank you for merging it! I think there are some spots where the documentation needs to be updated as well. EDIT: I've looked and can't seem to find the place I saw earlier. Anyway, thanks a lot! |
Could the addition of a new dependency here be reconsidered? This is adding a non-optional crate dependency just to use a single number. These numbers are pretty static, so it'd be just fine to define Moreover, On Unix, it seems like many applications don't bother with this at all. On my Linux system with GNU ls:
On macOS:
Indeed, it's not actually clear to me that So I guess I've muddled two concerns here:
|
I agree with @BurntSushi here. Clap is already a big project that adding a new dependency should be only in required justifiable cases |
Yup, my bad. I thought the exit codes differed on windows. |
PR clap-rs#1637 switched clap to report `64` on errors and then clap-rs#1653 switch it to 2, but both missed a case. This also documents the reason why inline since I had to go and dig through the history to re-discover the motivation.
PR clap-rs#1637 switched clap to report `64` on errors and then clap-rs#1653 switch it to `2`, but both missed a case. This also documents the reason why inline since I had to go and dig through the history to re-discover the motivation.
PR clap-rs#1637 switched clap to report `64` on errors and then clap-rs#1653 switch it to `2`, but both missed a case. This also documents the reason why inline since I had to go and dig through the history to re-discover the motivation.
PR clap-rs#1637 switched clap to report `64` on errors and then clap-rs#1653 switch it to `2`, but both missed a case. This also documents the reason why inline since I had to go and dig through the history to re-discover the motivation.
The reason to do this is described well in issue #1327.
It is also a recommendation of the Rust book itself:
https://rust-cli.github.io/book/in-depth/exit-code.html
I have run the tests with no failures: