Replies: 1 comment 5 replies
-
The removal of SubcommandRequiredElseHelp was intentional and not just to shrink clap's API surface / code size. If no arguments are provided, then it can make sense to show the help. However, when the user starts passing in arguments, thats showing an intention and we should report what went wrong with that intention which is much better served with |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm in the process of upgrading rustup from clap 3 to clap 4. The (hopefully) final remaining issue is what happens when we run
rustup -v
. With our setup in clap 3 (usingSubcommandRequiredElseHelp
), callingrustup
andrustup -v
would have the same result, of showing the help. With clap 4 (usingsubcommand_required(true).arg_required_else_help(true)
), the same behavior happens forrustup
butrustup -v
instead shows an error instead of the help:This seems like it might be a bug? Arguably
arg_required_else_help()
should trigger help if there is no subcommand, even if some options are present, right?Beta Was this translation helpful? Give feedback.
All reactions