Skip to content

Pretty exit for subcommand with required arg. #5859

Answered by epage
jmbarbier asked this question in Q&A
Discussion options

You must be logged in to vote

There used to be a setting SubcommandRequiredElseHelp which was removed in favor of separate arg_required_else_help (if any type of arg is present, no help is shown) and subcommand_required.

This was done for a couple of reasons

  • These are mostly redundant and we are working to reduce redundancies in the API to improve build times, reduce binary size, and make the API more discoverable by not overwhelming users
  • imo The error message, rather than help, is a better, more user friendly response. The help message doesn't say what the user did wrong and isn't giving directed feedback. Some CLIs do both, show the error and help but I feel like the error message is lost in all of the help output.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@jmbarbier
Comment options

Answer selected by jmbarbier
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants