Fix error messages in argparse examples (GH-6435) · python/cpython@04e8293

Original file line numberDiff line numberDiff line change

@@ -712,7 +712,7 @@ be positional::

712712

Namespace(bar='BAR', foo='FOO')

713713

>>> parser.parse_args(['--foo', 'FOO'])

714714

usage: PROG [-h] [-f FOO] bar

715-

PROG: error: too few arguments

715+

PROG: error: the following arguments are required: bar

716716
717717
718718

action

@@ -898,7 +898,7 @@ values are:

898898

Namespace(foo=['a', 'b'])

899899

>>> parser.parse_args([])

900900

usage: PROG [-h] foo [foo ...]

901-

PROG: error: too few arguments

901+

PROG: error: the following arguments are required: foo

902902
903903

.. _`argparse.REMAINDER`:

904904