summaryrefslogtreecommitdiffstats
path: root/Doc/library/argparse.rst
diff options
context:
space:
mode:
authorSandro Tosi <sandro.tosi@gmail.com>2012-01-19 21:23:17 (GMT)
committerSandro Tosi <sandro.tosi@gmail.com>2012-01-19 21:23:17 (GMT)
commit6a7b855a97c57f26d4786a9003757e39a43b322e (patch)
tree8c9daa4596353dd48e194a77b6d00ce0f42d5bb9 /Doc/library/argparse.rst
parent83d32c9135b75b366ebe0542b4c677c32682b0e1 (diff)
parentda8e11ac716b9ef0a9e6aed3f9bafe80ed625b2b (diff)
downloadcpython-6a7b855a97c57f26d4786a9003757e39a43b322e.zip
cpython-6a7b855a97c57f26d4786a9003757e39a43b322e.tar.gz
cpython-6a7b855a97c57f26d4786a9003757e39a43b322e.tar.bz2
Issue #13605: merge with 3.2
Diffstat (limited to 'Doc/library/argparse.rst')
-rw-r--r--Doc/library/argparse.rst10
1 files changed, 5 insertions, 5 deletions
diff --git a/Doc/library/argparse.rst b/Doc/library/argparse.rst
index 8ddccfb..2617ae5 100644
--- a/Doc/library/argparse.rst
+++ b/Doc/library/argparse.rst
@@ -859,16 +859,16 @@ values are:
usage: PROG [-h] foo [foo ...]
PROG: error: too few arguments
-* ``argparse.REMAINDER``. All the remaining command-line arguments
- are gathered into a lits. This is commonly useful for command line
- utilities that dispatch to other command line utilities.
+* ``argparse.REMAINDER``. All the remaining command-line arguments are gathered
+ into a list. This is commonly useful for command line utilities that dispatch
+ to other command line utilities.
>>> parser = argparse.ArgumentParser(prog='PROG')
>>> parser.add_argument('--foo')
>>> parser.add_argument('command')
>>> parser.add_argument('args', nargs=argparse.REMAINDER)
- >>> print parser.parse_args('--foo B XX YY ZZ'.split())
- Namespace(args=['YY', 'ZZ'], command='XX', foo='B')
+ >>> print parser.parse_args('--foo B cmd --arg1 XX ZZ'.split())
+ Namespace(args=['--arg1', 'XX', 'ZZ'], command='cmd', foo='B')
If the ``nargs`` keyword argument is not provided, the number of arguments consumed
is determined by the action_. Generally this means a single command-line argument