summaryrefslogtreecommitdiffstats
path: root/Doc/library/argparse.rst
diff options
context:
space:
mode:
authorSarahPythonista <4283226+SarahPythonista@users.noreply.github.com>2020-08-28 18:47:58 (GMT)
committerGitHub <noreply@github.com>2020-08-28 18:47:58 (GMT)
commit8784d3300ec4ffc58bc0e9ab3cff9a24187dbe4c (patch)
treebb6458bc11281574c1c6967a1dd6569acc67f964 /Doc/library/argparse.rst
parentd9a966ae08258da2ce2a432c943d8194760f09c4 (diff)
downloadcpython-8784d3300ec4ffc58bc0e9ab3cff9a24187dbe4c.zip
cpython-8784d3300ec4ffc58bc0e9ab3cff9a24187dbe4c.tar.gz
cpython-8784d3300ec4ffc58bc0e9ab3cff9a24187dbe4c.tar.bz2
Fix error in argparse documentation example (GH-17399)
Automerge-Triggered-By: @rhettinger
Diffstat (limited to 'Doc/library/argparse.rst')
-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 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