summaryrefslogtreecommitdiffstats
path: root/Doc/library
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2020-09-04 22:26:21 (GMT)
committerGitHub <noreply@github.com>2020-09-04 22:26:21 (GMT)
commite77547b90cb3b819113c722579a7fc070de0c2ca (patch)
tree38452b8ce78d8569e1c61e5e3c0c0146647e0290 /Doc/library
parent66e9c2aee4af846ab1b77faa8a46fe3a9373d943 (diff)
downloadcpython-e77547b90cb3b819113c722579a7fc070de0c2ca.zip
cpython-e77547b90cb3b819113c722579a7fc070de0c2ca.tar.gz
cpython-e77547b90cb3b819113c722579a7fc070de0c2ca.tar.bz2
[3.8] Fix error in argparse documentation example (GH-17399) (GH-21990)
Automerge-Triggered-By: @rhettinger (cherry picked from commit 8784d3300ec4ffc58bc0e9ab3cff9a24187dbe4c) Co-authored-by: SarahPythonista <4283226+SarahPythonista@users.noreply.github.com>
Diffstat (limited to 'Doc/library')
-rw-r--r--Doc/library/argparse.rst4
1 files changed, 2 insertions, 2 deletions
diff --git a/Doc/library/argparse.rst b/Doc/library/argparse.rst
index e1b28e3..2ec7ea3 100644
--- a/Doc/library/argparse.rst
+++ b/Doc/library/argparse.rst
@@ -1123,8 +1123,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