diff -r dda33191f7f5 Doc/library/argparse.rst --- a/Doc/library/argparse.rst Sun Apr 10 12:59:16 2011 +0300 +++ b/Doc/library/argparse.rst Sun Apr 10 18:16:29 2011 +0200 @@ -1371,7 +1371,10 @@ Sub-commands ^^^^^^^^^^^^ -.. method:: ArgumentParser.add_subparsers() +.. method:: ArgumentParser.add_subparsers([title], [description], [prog], \ + [parser_class], [action], \ + [option_string], [dest], [help], \ + [metavar]) Many programs split up their functionality into a number of sub-commands, for example, the ``svn`` program can invoke sub-commands like ``svn @@ -1384,6 +1387,29 @@ has a single method, ``add_parser``, which takes a command name and any :class:`ArgumentParser` constructor arguments, and returns an :class:`ArgumentParser` object that can be modified as usual. + + Description of parametres: + + * title - title for the sub-parser group in help output; by default + "subcommands" if description is provided, otherwise uses title for + positional arguments + + * description - description for the sub-parser group in help output, by + default None + + * prog - usage information that will be displayed with sub-command help, + by default name of the program + + * parser_class - class which will be used to create sub-parser instances, by + default it is the class of parent parser + + * dest - name of the attribute under which sub-command name will be + stored; by default None and no value is stored + + * help - help for sub-parser group in help output, by default None + + * metavar - string presenting available sub-commands in help; by default it + is None and presents sub-commands in form {cmd1, cmd2, ..} Some example usage::