]> granicus.if.org Git - python/commitdiff
Fix error messages in argparse examples (GH-6435)
authorsuic86 <marko.gabriel.cz@gmail.com>
Wed, 11 Apr 2018 18:45:04 +0000 (20:45 +0200)
committerZachary Ware <zachary.ware@gmail.com>
Wed, 11 Apr 2018 18:45:04 +0000 (13:45 -0500)
The examples in argparse documentation use `error: too few arguments`
error message which was removed in this commit f97c59a in 2011.

Doc/library/argparse.rst

index cc99cce2b27d2e1bfbf7f4c21295ca6134f08a03..3f327c0cfa77b7da41adea426287cad842407091 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`: