]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fix error in argparse documentation example (GH-17399)
authorSarahPythonista <4283226+SarahPythonista@users.noreply.github.com>
Fri, 28 Aug 2020 18:47:58 +0000 (11:47 -0700)
committerGitHub <noreply@github.com>
Fri, 28 Aug 2020 18:47:58 +0000 (11:47 -0700)
Automerge-Triggered-By: @rhettinger
Doc/library/argparse.rst

index 0b64dfe47f7689d57b0e466658ff8a4abafd1e2c..7a7a4cf94979a19ee5170183bb101a37725a7515 100644 (file)
@@ -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