diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2020-09-04 22:26:22 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-04 22:26:22 (GMT) |
commit | 78ef1b6b124bb89883f3b755ea4aeec480e0e21d (patch) | |
tree | cb4918f28457c458b753121ab6f553a38917f89b /Doc | |
parent | 672d8b9190ae9a9acd6a46b3c5559334884fb31c (diff) | |
download | cpython-78ef1b6b124bb89883f3b755ea4aeec480e0e21d.zip cpython-78ef1b6b124bb89883f3b755ea4aeec480e0e21d.tar.gz cpython-78ef1b6b124bb89883f3b755ea4aeec480e0e21d.tar.bz2 |
[3.9] Fix error in argparse documentation example (GH-17399) (GH-21992)
Automerge-Triggered-By: @rhettinger
(cherry picked from commit 8784d3300ec4ffc58bc0e9ab3cff9a24187dbe4c)
Co-authored-by: SarahPythonista <4283226+SarahPythonista@users.noreply.github.com>
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/argparse.rst | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Doc/library/argparse.rst b/Doc/library/argparse.rst index 0b64dfe..7a7a4cf 100644 --- a/Doc/library/argparse.rst +++ b/Doc/library/argparse.rst @@ -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 |