From: SarahPythonista <4283226+SarahPythonista@users.noreply.github.com> Date: Fri, 28 Aug 2020 18:47:58 +0000 (-0700) Subject: Fix error in argparse documentation example (GH-17399) X-Git-Tag: v3.10.0a1~216 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8784d3300ec4ffc58bc0e9ab3cff9a24187dbe4c;p=thirdparty%2FPython%2Fcpython.git Fix error in argparse documentation example (GH-17399) Automerge-Triggered-By: @rhettinger --- diff --git a/Doc/library/argparse.rst b/Doc/library/argparse.rst index 0b64dfe47f76..7a7a4cf94979 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