Skip to content

Grouping ArgGroup in help message? #3831

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

You must be logged in to vote

In clap, ArgGroup is meant to create an alias for a group of arguments and may have its own validation rules. One argument can belong to multiple groups.

In argparse, add_argument_group is more visual while add_mutually_exclusive_group is closer to what ArgGroup does but is still less powerful (only handles mutually exclusive, only one group allows).

For creating sections in the help, what you want is Arg::help_heading or Command::next_help_heading.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@tobiasvl
Comment options

@alkeryn
Comment options

@epage
Comment options

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