Lines Matching full:help
24 module also automatically generates help and usage messages and issues errors
38 help='an integer for the accumulator')
41 help='sum the integers (default: find the max)')
47 be run at the command line and provides useful help messages:
60 -h, --help show this help message and exit
107 ... help='an integer for the accumulator')
110 ... help='sum the integers (default: find the max)')
155 * description_ - Text to display before the argument help (default: none)
157 * epilog_ - Text to display after the argument help (default: none)
162 * formatter_class_ - A class for customizing the help output
176 * add_help_ - Add a ``-h/--help`` option to the parser (default: ``True``)
185 how to display the name of the program in help messages. This default is almost
186 always desirable because it will make the help messages match how the program was
192 parser.add_argument('--foo', help='foo help')
195 The help for this program will display ``myprogram.py`` as the program name
200 $ python myprogram.py --help
204 -h, --help show this help message and exit
205 --foo FOO foo help
207 $ python subdir/myprogram.py --help
211 -h, --help show this help message and exit
212 --foo FOO foo help
222 -h, --help show this help message and exit
225 ``prog=`` argument, is available to help messages using the ``%(prog)s`` format
231 >>> parser.add_argument('--foo', help='foo of the %(prog)s program')
236 -h, --help show this help message and exit
247 >>> parser.add_argument('--foo', nargs='?', help='foo help')
248 >>> parser.add_argument('bar', nargs='+', help='bar help')
253 bar bar help
256 -h, --help show this help message and exit
257 --foo [FOO] foo help
262 >>> parser.add_argument('--foo', nargs='?', help='foo help')
263 >>> parser.add_argument('bar', nargs='+', help='bar help')
268 bar bar help
271 -h, --help show this help message and exit
272 --foo [FOO] foo help
283 what the program does and how it works. In help messages, the description is
284 displayed between the command-line usage string and the help messages for the
294 -h, --help show this help message and exit
316 -h, --help show this help message and exit
349 :class:`ArgumentParser` will see two ``-h/--help`` options (one in the parent
361 :class:`ArgumentParser` objects allow the help formatting to be customized by
373 epilog_ texts in command-line help messages::
390 -h, --help show this help message and exit
419 -h, --help show this help message and exit
421 :class:`RawTextHelpFormatter` maintains whitespace for all sorts of help text,
432 >>> parser.add_argument('--foo', type=int, default=42, help='FOO!')
433 >>> parser.add_argument('bar', nargs='*', default=[1, 2, 3], help='BAR!')
441 -h, --help show this help message and exit
522 >>> parser.add_argument('-f', '--foo', help='old foo help')
523 >>> parser.add_argument('--foo', help='new foo help')
534 >>> parser.add_argument('-f', '--foo', help='old foo help')
535 >>> parser.add_argument('--foo', help='new foo help')
540 -h, --help show this help message and exit
541 -f FOO old foo help
542 --foo FOO new foo help
554 the parser's help message. For example, consider a file named
559 parser.add_argument('--foo', help='foo help')
562 If ``-h`` or ``--help`` is supplied at the command line, the ArgumentParser
563 help will be printed:
567 $ python myprogram.py --help
571 -h, --help show this help message and exit
572 --foo FOO foo help
574 Occasionally, it may be useful to disable the addition of this help option.
579 >>> parser.add_argument('--foo', help='foo help')
584 --foo FOO foo help
586 The help option is typically ``-h/--help``. The exception to this is
588 which case ``-h`` and ``--help`` are not valid options. In
590 the help options::
597 +h, ++help show this help message and exit
605 [help], [metavar], [dest])
739 * ``'help'`` - This prints a complete help message for all the options in the
740 current parser and then exits. By default a help action is automatically
1071 help section in The add_argument() method
1074 The ``help`` value is a string containing a brief description of the argument.
1075 When a user requests help (usually by using ``-h`` or ``--help`` at the
1076 command line), these ``help`` descriptions will be displayed with each
1081 ... help='foo the bars before frobbling')
1083 ... help='one of the bars to be frobbled')
1091 -h, --help show this help message and exit
1094 The ``help`` strings can include various format specifiers to avoid repetition
1101 ... help='the bar to %(prog)s (default: %(default)s)')
1109 -h, --help show this help message and exit
1111 :mod:`argparse` supports silencing the help entry for certain options, by
1112 setting the ``help`` value to ``argparse.SUPPRESS``::
1115 >>> parser.add_argument('--foo', help=argparse.SUPPRESS)
1120 -h, --help show this help message and exit
1126 When :class:`ArgumentParser` generates help messages, it needs some way to refer
1147 -h, --help show this help message and exit
1164 -h, --help show this help message and exit
1182 -h, --help show this help message and exit
1234 type=None, choices=None, required=False, help=None, \
1244 "required", "help", etc. defined. The easiest way to ensure these attributes
1438 ... nargs='+', help='an integer in the range 0..9')
1441 ... default=max, help='sum the integers (default: find the max)')
1490 [option_string], [dest], [help], \
1507 * title - title for the sub-parser group in help output; by default
1511 * description - description for the sub-parser group in help output, by
1514 * prog - usage information that will be displayed with sub-command help,
1527 * help_ - help for sub-parser group in help output, by default ``None``
1529 * metavar_ - string presenting available sub-commands in help; by default it
1536 >>> parser.add_argument('--foo', action='store_true', help='foo help')
1537 >>> subparsers = parser.add_subparsers(help='sub-command help')
1540 >>> parser_a = subparsers.add_parser('a', help='a help')
1541 >>> parser_a.add_argument('bar', type=int, help='bar help')
1544 >>> parser_b = subparsers.add_parser('b', help='b help')
1545 >>> parser_b.add_argument('--baz', choices='XYZ', help='baz help')
1560 Similarly, when a help message is requested from a subparser, only the help
1561 for that particular parser will be printed. The help message will not
1562 include parent parser or sibling parser messages. (A help message for each
1563 subparser command, however, can be given by supplying the ``help=`` argument
1568 >>> parser.parse_args(['--help'])
1572 {a,b} sub-command help
1573 a a help
1574 b b help
1577 -h, --help show this help message and exit
1578 --foo foo help
1580 >>> parser.parse_args(['a', '--help'])
1584 bar bar help
1587 -h, --help show this help message and exit
1589 >>> parser.parse_args(['b', '--help'])
1593 -h, --help show this help message and exit
1594 --baz {X,Y,Z} baz help
1598 appear in their own group in the help output. For example::
1603 ... help='additional help')
1610 -h, --help show this help message and exit
1615 {foo,bar} additional help
1703 "positional arguments" and "optional arguments" when displaying help
1710 >>> group.add_argument('--foo', help='foo help')
1711 >>> group.add_argument('bar', help='bar help')
1716 bar bar help
1717 --foo FOO foo help
1723 separate group for help messages. The :meth:`add_argument_group` method
1729 >>> group1.add_argument('foo', help='foo help')
1731 >>> group2.add_argument('--bar', help='bar help')
1738 foo foo help
1743 --bar BAR bar help
1828 Printing help
1843 Print a help message, including the program usage and information about the
1857 Return a string containing a help message, including the program usage and