Lines Matching full:help
25 module also automatically generates help and usage messages. The module
39 epilog='Text at the bottom of help')
63 …onst'``, ``'store_true'``, ``'append'``, ``'append_const'``, ``'count'``, ``'help'``, ``'version'``
68 help_ Help message for an argument
69 metavar_ Alternate display name for the argument as shown in help
86 help='an integer for the accumulator')
89 help='sum the integers (default: find the max)')
95 be run at the command line and it provides useful help messages:
108 -h, --help show this help message and exit
155 ... help='an integer for the accumulator')
158 ... help='sum the integers (default: find the max)')
204 * description_ - Text to display before the argument help
207 * epilog_ - Text to display after the argument help (by default, no text)
212 * formatter_class_ - A class for customizing the help output
226 * add_help_ - Add a ``-h/--help`` option to the parser (default: ``True``)
253 how to display the name of the program in help messages. This default is almost
254 always desirable because it will make the help messages match how the program was
260 parser.add_argument('--foo', help='foo help')
263 The help for this program will display ``myprogram.py`` as the program name
268 $ python myprogram.py --help
272 -h, --help show this help message and exit
273 --foo FOO foo help
275 $ python subdir/myprogram.py --help
279 -h, --help show this help message and exit
280 --foo FOO foo help
290 -h, --help show this help message and exit
293 ``prog=`` argument, is available to help messages using the ``%(prog)s`` format
299 >>> parser.add_argument('--foo', help='foo of the %(prog)s program')
304 -h, --help show this help message and exit
315 >>> parser.add_argument('--foo', nargs='?', help='foo help')
316 >>> parser.add_argument('bar', nargs='+', help='bar help')
321 bar bar help
324 -h, --help show this help message and exit
325 --foo [FOO] foo help
330 >>> parser.add_argument('--foo', nargs='?', help='foo help')
331 >>> parser.add_argument('bar', nargs='+', help='bar help')
336 bar bar help
339 -h, --help show this help message and exit
340 --foo [FOO] foo help
353 what the program does and how it works. In help messages, the description is
354 displayed between the command-line usage string and the help messages for the
364 -h, --help show this help message and exit
386 -h, --help show this help message and exit
419 :class:`ArgumentParser` will see two ``-h/--help`` options (one in the parent
433 :class:`ArgumentParser` objects allow the help formatting to be customized by
445 epilog_ texts in command-line help messages::
462 -h, --help show this help message and exit
491 -h, --help show this help message and exit
493 :class:`RawTextHelpFormatter` maintains whitespace for all sorts of help text,
499 default values to each of the argument help messages::
504 >>> parser.add_argument('--foo', type=int, default=42, help='FOO!')
505 >>> parser.add_argument('bar', nargs='*', default=[1, 2, 3], help='BAR!')
513 -h, --help show this help message and exit
532 -h, --help show this help message and exit
633 >>> parser.add_argument('-f', '--foo', help='old foo help')
634 >>> parser.add_argument('--foo', help='new foo help')
645 >>> parser.add_argument('-f', '--foo', help='old foo help')
646 >>> parser.add_argument('--foo', help='new foo help')
651 -h, --help show this help message and exit
652 -f FOO old foo help
653 --foo FOO new foo help
665 the parser's help message. For example, consider a file named
670 parser.add_argument('--foo', help='foo help')
673 If ``-h`` or ``--help`` is supplied at the command line, the ArgumentParser
674 help will be printed:
678 $ python myprogram.py --help
682 -h, --help show this help message and exit
683 --foo FOO foo help
685 Occasionally, it may be useful to disable the addition of this help option.
690 >>> parser.add_argument('--foo', help='foo help')
695 --foo FOO foo help
697 The help option is typically ``-h/--help``. The exception to this is
699 which case ``-h`` and ``--help`` are not valid options. In
701 the help options::
708 +h, ++help show this help message and exit
722 …', nargs=None, const=None, default=None, type=<class 'int'>, choices=None, help=None, metavar=None)
738 [help], [metavar], [dest])
882 * ``'help'`` - This prints a complete help message for all the options in the
883 current parser and then exits. By default a help action is automatically
1232 control its appearance in usage, help, and error messages.
1270 help section in The add_argument() method
1273 The ``help`` value is a string containing a brief description of the argument.
1274 When a user requests help (usually by using ``-h`` or ``--help`` at the
1275 command line), these ``help`` descriptions will be displayed with each
1280 ... help='foo the bars before frobbling')
1282 ... help='one of the bars to be frobbled')
1290 -h, --help show this help message and exit
1293 The ``help`` strings can include various format specifiers to avoid repetition
1300 ... help='the bar to %(prog)s (default: %(default)s)')
1308 -h, --help show this help message and exit
1310 As the help string supports %-formatting, if you want a literal ``%`` to appear
1311 in the help string, you must escape it as ``%%``.
1313 :mod:`argparse` supports silencing the help entry for certain options, by
1314 setting the ``help`` value to ``argparse.SUPPRESS``::
1317 >>> parser.add_argument('--foo', help=argparse.SUPPRESS)
1322 -h, --help show this help message and exit
1330 When :class:`ArgumentParser` generates help messages, it needs some way to refer argument
1351 -h, --help show this help message and exit
1368 -h, --help show this help message and exit
1386 -h, --help show this help message and exit
1441 type=None, choices=None, required=False, help=None, \
1452 "required", "help", etc. defined. The easiest way to ensure these attributes
1650 ... nargs='+', help='an integer in the range 0..9')
1653 ... default=max, help='sum the integers (default: find the max)')
1703 [help], [metavar])
1719 * title - title for the sub-parser group in help output; by default
1723 * description - description for the sub-parser group in help output, by
1726 * prog - usage information that will be displayed with sub-command help,
1742 * help_ - help for sub-parser group in help output, by default ``None``
1744 * metavar_ - string presenting available sub-commands in help; by default it
1751 >>> parser.add_argument('--foo', action='store_true', help='foo help')
1752 >>> subparsers = parser.add_subparsers(help='sub-command help')
1755 >>> parser_a = subparsers.add_parser('a', help='a help')
1756 >>> parser_a.add_argument('bar', type=int, help='bar help')
1759 >>> parser_b = subparsers.add_parser('b', help='b help')
1760 >>> parser_b.add_argument('--baz', choices='XYZ', help='baz help')
1775 Similarly, when a help message is requested from a subparser, only the help
1776 for that particular parser will be printed. The help message will not
1777 include parent parser or sibling parser messages. (A help message for each
1778 subparser command, however, can be given by supplying the ``help=`` argument
1783 >>> parser.parse_args(['--help'])
1787 {a,b} sub-command help
1788 a a help
1789 b b help
1792 -h, --help show this help message and exit
1793 --foo foo help
1795 >>> parser.parse_args(['a', '--help'])
1799 bar bar help
1802 -h, --help show this help message and exit
1804 >>> parser.parse_args(['b', '--help'])
1808 -h, --help show this help message and exit
1809 --baz {X,Y,Z} baz help
1813 appear in their own group in the help output. For example::
1818 ... help='additional help')
1825 -h, --help show this help message and exit
1830 {foo,bar} additional help
1936 "positional arguments" and "options" when displaying help
1943 >>> group.add_argument('--foo', help='foo help')
1944 >>> group.add_argument('bar', help='bar help')
1949 bar bar help
1950 --foo FOO foo help
1956 separate group for help messages. The :meth:`add_argument_group` method
1962 >>> group1.add_argument('foo', help='foo help')
1964 >>> group2.add_argument('--bar', help='bar help')
1971 foo foo help
1976 --bar BAR bar help
2073 Printing help
2088 Print a help message, including the program usage and information about the
2102 Return a string containing a help message, including the program usage and