-
-
Notifications
You must be signed in to change notification settings - Fork 1.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
Derive should only show help when argc==1 rather than missing subcommand #3280
Comments
I do not think this dramatically breaks user expectations that this would be considered a breaking change and can happen anytime, |
Personally, I think we should deprecate and remove 29ca7b2 and #133 don't include details as to why we have both. |
I guess a question for 4.0 is if we should stop including |
Experimented with this recently. |
Showing help on `$ cmd` makes sense but when an arg is present but not subcommand, that suggests the user missed something, so we should show a more specific error message. Compatibility note: Settings we apply for subcommands have changed. Fixes clap-rs#3280
With clap-rs#3280 resolved where we can use `SubcommandRequired | ArgRequiredElseHelp`, this setting offers little value but requires we track required subcommands with two different settings. Deprecating as the cost is not worth the benefit anymore.
Now that we can use `SubcommandRequired | ArgRequiredElseHelp`, this setting offers little value but requires we track required subcommands with two different settings. Deprecating as the cost is not worth the benefit anymore. Issue clap-rs#3280 will see the derive updated
This also let us remove the deprecated attribute Fixes clap-rs#3280
This also let us remove the deprecated attribute Fixes clap-rs#3280
This also let us remove the deprecated attribute Fixes clap-rs#3280
Please complete the following tasks
Rust Version
rustc 1.57.0 (f1edd0429 2021-11-29)
Clap Version
v3.0.6
Minimal reproducible code
Steps to reproduce the bug with the above code
$ cargo run -- -v
Actual Behaviour
Expected Behaviour
Additional Context
To reproduce the desired behavior:
This was inspired by a conversation in #2513
In my mind, showing of help should be reserved for when the user has taken no action but
SubcommandRequired
allows the user to pass some arguments. In those cases, we should be showing a more specific error message than a long, generic message that takes the user some work to figure out what the next steps are.Debug Output
No response
The text was updated successfully, but these errors were encountered: