mirror of
https://github.com/python/cpython.git
synced 2025-07-22 18:55:22 +00:00
Fix error in argparse documentation example (GH-17399)
Automerge-Triggered-By: @rhettinger
This commit is contained in:
parent
d9a966ae08
commit
8784d3300e
1 changed files with 2 additions and 2 deletions
|
@ -1162,8 +1162,8 @@ keyword argument to :meth:`~ArgumentParser.add_argument`::
|
|||
>>> parser.parse_args(['--foo', 'BAR'])
|
||||
Namespace(foo='BAR')
|
||||
>>> parser.parse_args([])
|
||||
usage: argparse.py [-h] [--foo FOO]
|
||||
argparse.py: error: option --foo is required
|
||||
usage: [-h] --foo FOO
|
||||
: error: the following arguments are required: --foo
|
||||
|
||||
As the example shows, if an option is marked as ``required``,
|
||||
:meth:`~ArgumentParser.parse_args` will report an error if that option is not
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue