summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSandro Tosi <sandro.tosi@gmail.com>2012-01-04 22:25:20 (GMT)
committerSandro Tosi <sandro.tosi@gmail.com>2012-01-04 22:25:20 (GMT)
commit412d0f2f986cc7a7d7254922cafc899a53316dcf (patch)
tree8a6d7a41051e72dd4b34d524943b3d047724bcf9
parentf7e7818e245f14c94ce123746efd427634e56109 (diff)
parent98492a50ea30d2dffd7e16054e3aeb35cb2fed8d (diff)
downloadcpython-412d0f2f986cc7a7d7254922cafc899a53316dcf.zip
cpython-412d0f2f986cc7a7d7254922cafc899a53316dcf.tar.gz
cpython-412d0f2f986cc7a7d7254922cafc899a53316dcf.tar.bz2
merge with 3.2
-rw-r--r--Doc/library/argparse.rst13
1 files changed, 13 insertions, 0 deletions
diff --git a/Doc/library/argparse.rst b/Doc/library/argparse.rst
index c280704..1f0ea2d 100644
--- a/Doc/library/argparse.rst
+++ b/Doc/library/argparse.rst
@@ -724,6 +724,19 @@ how the command-line arguments should be handled. The supported actions are:
>>> parser.parse_args('--str --int'.split())
Namespace(types=[<class 'str'>, <class 'int'>])
+* ``'count'`` - This counts the number of times a keyword argument occurs. For
+ example, this is useful for increasing verbosity levels::
+
+ >>> parser = argparse.ArgumentParser()
+ >>> parser.add_argument('--verbose', '-v', action='count')
+ >>> parser.parse_args('-vvv'.split())
+ Namespace(verbose=3)
+
+* ``'help'`` - This prints a complete help message for all the options in the
+ current parser and then exits. By default a help action is automatically
+ added to the parser. See :class:`ArgumentParser` for details of how the
+ output is created.
+
* ``'version'`` - This expects a ``version=`` keyword argument in the
:meth:`~ArgumentParser.add_argument` call, and prints version information
and exits when invoked.