Skip to content

Commit 8784d33

Browse files
Fix error in argparse documentation example (pythonGH-17399)
Automerge-Triggered-By: @rhettinger
1 parent d9a966a commit 8784d33

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Doc/library/argparse.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -1162,8 +1162,8 @@ keyword argument to :meth:`~ArgumentParser.add_argument`::
11621162
>>> parser.parse_args(['--foo', 'BAR'])
11631163
Namespace(foo='BAR')
11641164
>>> parser.parse_args([])
1165-
usage: argparse.py [-h] [--foo FOO]
1166-
argparse.py: error: option --foo is required
1165+
usage: [-h] --foo FOO
1166+
: error: the following arguments are required: --foo
11671167

11681168
As the example shows, if an option is marked as ``required``,
11691169
:meth:`~ArgumentParser.parse_args` will report an error if that option is not

0 commit comments

Comments
 (0)