diff -r 18e43c6acfff Doc/library/argparse.rst --- a/Doc/library/argparse.rst Wed May 04 12:47:14 2011 -0700 +++ b/Doc/library/argparse.rst Sun May 29 07:47:21 2011 -0700 @@ -724,6 +724,19 @@ >>> parser.parse_args('--str --int'.split()) Namespace(types=[, ]) +* ``'count'`` - This counts the number of times a keyword argument occurs. + This is useful for increasing verbosity levels. For example:: + + >>> 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. @@ -734,6 +747,10 @@ >>> parser.parse_args(['--version']) PROG 2.0 +* ``'parsers'`` - This action is used internally by + :meth:`~ArgumentParser.add_subparsers()` to help break functionality into + sub-commands_. + You can also specify an arbitrary action by passing an object that implements the Action API. The easiest way to do this is to extend :class:`argparse.Action`, supplying an appropriate ``__call__`` method. The