]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fix error messages in argparse examples (GH-6435)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Wed, 11 Apr 2018 19:05:52 +0000 (12:05 -0700)
committerGitHub <noreply@github.com>
Wed, 11 Apr 2018 19:05:52 +0000 (12:05 -0700)
The examples in argparse documentation use `error: too few arguments`
error message which was removed in this commit f97c59a in 2011.
(cherry picked from commit 04e82934659487ecae76bf4a2db7f92c8dbe0d25)

Co-authored-by: suic86 <marko.gabriel.cz@gmail.com>
Doc/library/argparse.rst

index 27c7ba558204865284542c1348684091346e2623..c5bc1eebd7de5a2d3f0f26f9f75894e8c6ef2f56 100644 (file)
@@ -712,7 +712,7 @@ be positional::
    Namespace(bar='BAR', foo='FOO')
    >>> parser.parse_args(['--foo', 'FOO'])
    usage: PROG [-h] [-f FOO] bar
-   PROG: error: too few arguments
+   PROG: error: the following arguments are required: bar
 
 
 action
@@ -898,7 +898,7 @@ values are:
      Namespace(foo=['a', 'b'])
      >>> parser.parse_args([])
      usage: PROG [-h] foo [foo ...]
-     PROG: error: too few arguments
+     PROG: error: the following arguments are required: foo
 
 .. _`argparse.REMAINDER`: