Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion Doc/library/argparse.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1750,7 +1750,9 @@ Subcommands
* help_ - help for sub-parser group in help output, by default ``None``

* metavar_ - string presenting available subcommands in help; by default it
is ``None`` and presents subcommands in form {cmd1, cmd2, ..}
is ``None`` and presents subcommands in form {cmd1, cmd2, ..} in the usage line
and next to the subparsers group heading. It does not change how the
individual subcommands are listed below that heading
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd suggest using the same format as the description for dest. Maybe something like the following will keep it more concise (argparse docs are already quite long 😅 ):

* metavar_ - placeholder shown in the usage line and in the help entry for the subparsers argument
  in place of {cmd1, cmd2, ..}; by default ``None``

This wasn't something you changed but technically speaking, metavar actually replaces the list of subcommands, it doesn't present it.


Some example usage::

Expand Down
Loading