Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
6 changes: 4 additions & 2 deletions Doc/library/argparse.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1745,10 +1745,12 @@ Sub-commands
encountered at the command line

* dest_ - name of the attribute under which sub-command name will be
stored; by default ``None`` and no value is stored
stored; by default ``None`` and no value is stored. Required if
required_ has been passed

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.

‘Required if required’ doesn’t read well.

maybe just remove this addition. Is it not enough to document this under ‘required’?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Apologies for the radio silence, I have removed the line as requested, as yes it isn't needed


* required_ - Whether or not a subcommand must be provided, by default
``False`` (added in 3.7)
``False``. If this option parameter is passed then it is required
to also pass in dest_ (added in 3.7)

* help_ - help for sub-parser group in help output, by default ``None``

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Added two lines to :func:`argparse.add_subparsers`, to tell user to always
add the dest parameter if the required parameter is passed