Lines Matching full:help
25 module also automatically generates help and usage messages and issues errors
39 help='an integer for the accumulator')
42 help='sum the integers (default: find the max)')
48 be run at the command line and provides useful help messages:
61 -h, --help show this help message and exit
108 ... help='an integer for the accumulator')
111 ... help='sum the integers (default: find the max)')
157 * description_ - Text to display before the argument help (default: none)
159 * epilog_ - Text to display after the argument help (default: none)
164 * formatter_class_ - A class for customizing the help output
178 * add_help_ - Add a ``-h/--help`` option to the parser (default: ``True``)
203 how to display the name of the program in help messages. This default is almost
204 always desirable because it will make the help messages match how the program was
210 parser.add_argument('--foo', help='foo help')
213 The help for this program will display ``myprogram.py`` as the program name
218 $ python myprogram.py --help
222 -h, --help show this help message and exit
223 --foo FOO foo help
225 $ python subdir/myprogram.py --help
229 -h, --help show this help message and exit
230 --foo FOO foo help
240 -h, --help show this help message and exit
243 ``prog=`` argument, is available to help messages using the ``%(prog)s`` format
249 >>> parser.add_argument('--foo', help='foo of the %(prog)s program')
254 -h, --help show this help message and exit
265 >>> parser.add_argument('--foo', nargs='?', help='foo help')
266 >>> parser.add_argument('bar', nargs='+', help='bar help')
271 bar bar help
274 -h, --help show this help message and exit
275 --foo [FOO] foo help
280 >>> parser.add_argument('--foo', nargs='?', help='foo help')
281 >>> parser.add_argument('bar', nargs='+', help='bar help')
286 bar bar help
289 -h, --help show this help message and exit
290 --foo [FOO] foo help
301 what the program does and how it works. In help messages, the description is
302 displayed between the command-line usage string and the help messages for the
312 -h, --help show this help message and exit
334 -h, --help show this help message and exit
367 :class:`ArgumentParser` will see two ``-h/--help`` options (one in the parent
379 :class:`ArgumentParser` objects allow the help formatting to be customized by
391 epilog_ texts in command-line help messages::
408 -h, --help show this help message and exit
437 -h, --help show this help message and exit
439 :class:`RawTextHelpFormatter` maintains whitespace for all sorts of help text,
445 default values to each of the argument help messages::
450 >>> parser.add_argument('--foo', type=int, default=42, help='FOO!')
451 >>> parser.add_argument('bar', nargs='*', default=[1, 2, 3], help='BAR!')
459 -h, --help show this help message and exit
478 -h, --help show this help message and exit
579 >>> parser.add_argument('-f', '--foo', help='old foo help')
580 >>> parser.add_argument('--foo', help='new foo help')
591 >>> parser.add_argument('-f', '--foo', help='old foo help')
592 >>> parser.add_argument('--foo', help='new foo help')
597 -h, --help show this help message and exit
598 -f FOO old foo help
599 --foo FOO new foo help
611 the parser's help message. For example, consider a file named
616 parser.add_argument('--foo', help='foo help')
619 If ``-h`` or ``--help`` is supplied at the command line, the ArgumentParser
620 help will be printed:
624 $ python myprogram.py --help
628 -h, --help show this help message and exit
629 --foo FOO foo help
631 Occasionally, it may be useful to disable the addition of this help option.
636 >>> parser.add_argument('--foo', help='foo help')
641 --foo FOO foo help
643 The help option is typically ``-h/--help``. The exception to this is
645 which case ``-h`` and ``--help`` are not valid options. In
647 the help options::
654 +h, ++help show this help message and exit
668 …', nargs=None, const=None, default=None, type=<class 'int'>, choices=None, help=None, metavar=None)
684 [help], [metavar], [dest])
820 * ``'help'`` - This prints a complete help message for all the options in the
821 current parser and then exits. By default a help action is automatically
1156 control its appearance in usage, help, and error messages.
1190 help section in The add_argument() method
1193 The ``help`` value is a string containing a brief description of the argument.
1194 When a user requests help (usually by using ``-h`` or ``--help`` at the
1195 command line), these ``help`` descriptions will be displayed with each
1200 ... help='foo the bars before frobbling')
1202 ... help='one of the bars to be frobbled')
1210 -h, --help show this help message and exit
1213 The ``help`` strings can include various format specifiers to avoid repetition
1220 ... help='the bar to %(prog)s (default: %(default)s)')
1228 -h, --help show this help message and exit
1230 As the help string supports %-formatting, if you want a literal ``%`` to appear
1231 in the help string, you must escape it as ``%%``.
1233 :mod:`argparse` supports silencing the help entry for certain options, by
1234 setting the ``help`` value to ``argparse.SUPPRESS``::
1237 >>> parser.add_argument('--foo', help=argparse.SUPPRESS)
1242 -h, --help show this help message and exit
1248 When :class:`ArgumentParser` generates help messages, it needs some way to refer
1269 -h, --help show this help message and exit
1286 -h, --help show this help message and exit
1304 -h, --help show this help message and exit
1357 type=None, choices=None, required=False, help=None, \
1368 "required", "help", etc. defined. The easiest way to ensure these attributes
1566 ... nargs='+', help='an integer in the range 0..9')
1569 ... default=max, help='sum the integers (default: find the max)')
1619 [help], [metavar])
1635 * title - title for the sub-parser group in help output; by default
1639 * description - description for the sub-parser group in help output, by
1642 * prog - usage information that will be displayed with sub-command help,
1658 * help_ - help for sub-parser group in help output, by default ``None``
1660 * metavar_ - string presenting available sub-commands in help; by default it
1667 >>> parser.add_argument('--foo', action='store_true', help='foo help')
1668 >>> subparsers = parser.add_subparsers(help='sub-command help')
1671 >>> parser_a = subparsers.add_parser('a', help='a help')
1672 >>> parser_a.add_argument('bar', type=int, help='bar help')
1675 >>> parser_b = subparsers.add_parser('b', help='b help')
1676 >>> parser_b.add_argument('--baz', choices='XYZ', help='baz help')
1691 Similarly, when a help message is requested from a subparser, only the help
1692 for that particular parser will be printed. The help message will not
1693 include parent parser or sibling parser messages. (A help message for each
1694 subparser command, however, can be given by supplying the ``help=`` argument
1699 >>> parser.parse_args(['--help'])
1703 {a,b} sub-command help
1704 a a help
1705 b b help
1708 -h, --help show this help message and exit
1709 --foo foo help
1711 >>> parser.parse_args(['a', '--help'])
1715 bar bar help
1718 -h, --help show this help message and exit
1720 >>> parser.parse_args(['b', '--help'])
1724 -h, --help show this help message and exit
1725 --baz {X,Y,Z} baz help
1729 appear in their own group in the help output. For example::
1734 ... help='additional help')
1741 -h, --help show this help message and exit
1746 {foo,bar} additional help
1852 "positional arguments" and "optional arguments" when displaying help
1859 >>> group.add_argument('--foo', help='foo help')
1860 >>> group.add_argument('bar', help='bar help')
1865 bar bar help
1866 --foo FOO foo help
1872 separate group for help messages. The :meth:`add_argument_group` method
1878 >>> group1.add_argument('foo', help='foo help')
1880 >>> group2.add_argument('--bar', help='bar help')
1887 foo foo help
1892 --bar BAR bar help
1977 Printing help
1992 Print a help message, including the program usage and information about the
2006 Return a string containing a help message, including the program usage and