Lines Matching defs:help

485     failures = ['--bar', '-fbar', '-b B', 'B', '-f', '--bar B', '-baz', '-h', '--help', '+h', '::help', '/help']
497 """When ``-`` not in prefix_chars, default operators created for help
2058 prefix_chars[0] * 2 + 'foo', action='store_true', help='foo help')
2063 '--foo', action='store_true', help='foo help')
2065 'bar', type=float, help='bar help')
2073 subparsers_kwargs['help'] = 'command help'
2080 parser1_kwargs['help'] = '1 help'
2084 parser1.add_argument('-w', type=int, help='w help')
2085 parser1.add_argument('x', choices='abc', help='x help')
2090 parser2_kwargs['help'] = '2 help'
2092 parser2.add_argument('-y', choices='123', help='y help')
2093 parser2.add_argument('z', type=complex, nargs='*', help='z help')
2098 parser3_kwargs['help'] = '3 help'
2100 parser3.add_argument('t', type=int, help='t help')
2101 parser3.add_argument('u', nargs='...', help='u help')
2238 bar bar help
2239 {1,2,3} command help
2242 -h, --help show this help message and exit
2243 --foo foo help
2247 # Make sure - is still used for help if it is a non-first prefix char
2257 bar bar help
2258 {1,2,3} command help
2261 -h, --help show this help message and exit
2262 ++foo foo help
2270 help='help message containing non-breaking spaces shall not '
2278 -h, --help show this help message and exit
2279 --non-breaking help message containing non-breaking spaces shall not
2289 help=' ')
2298 -h, --help show this help message and exit
2305 help='%(choices)s')
2314 -h, --help show this help message and exit
2327 bar bar help
2328 {1,2,3} command help
2331 +h, ++help show this help message and exit
2332 ++foo foo help
2345 bar bar help
2346 {1,2,3} command help
2347 1 1 help
2348 2 2 help
2349 3 3 help
2352 -h, --help show this help message and exit
2353 --foo foo help
2359 parser.add_argument('--foo', action='store_true', help='foo help')
2360 parser.add_argument('bar', help='bar help')
2362 description='command help',
2363 help='additional text')
2374 bar bar help
2377 -h, --help show this help message and exit
2378 --foo foo help
2381 command help
2398 {a,b,c} x help
2401 -h, --help show this help message and exit
2402 -w W w help
2412 z z help
2415 -h, --help show this help message and exit
2416 -y {1,2,3} y help
2444 bar bar help
2447 -h, --help show this help message and exit
2448 --foo foo help
2453 1 help
2454 2 2 help
2455 3 3 help
2635 -h, --help show this help message and exit
2665 -h, --help show this help message and exit
2710 -h, --help show this help message and exit
2764 help = self.usage_when_not_required + self.help
2765 self.assertEqual(format_help(), textwrap.dedent(help))
2769 help = self.usage_when_required + self.help
2770 self.assertEqual(format_help(), textwrap.dedent(help))
2778 group.add_argument('--bar', help='bar help')
2779 group.add_argument('--baz', nargs='?', const='Z', help='baz help')
2799 help = '''\
2802 -h, --help show this help message and exit
2803 --bar BAR bar help
2804 --baz [BAZ] baz help
2812 parser.add_argument('--abcde', help='abcde help')
2813 parser.add_argument('--fghij', help='fghij help')
2815 group.add_argument('--klmno', help='klmno help')
2816 group.add_argument('--pqrst', help='pqrst help')
2840 help = '''\
2843 -h, --help show this help message and exit
2844 --abcde ABCDE abcde help
2845 --fghij FGHIJ fghij help
2846 --klmno KLMNO klmno help
2847 --pqrst PQRST pqrst help
2856 group.add_argument('-x', help=argparse.SUPPRESS)
2857 group.add_argument('-y', action='store_false', help='y help')
2876 help = '''\
2879 -h, --help show this help message and exit
2880 -y y help
2890 add('--spam', action='store_true', help=argparse.SUPPRESS)
2891 add('--badger', action='store_false', help=argparse.SUPPRESS)
2892 add('--bladder', help=argparse.SUPPRESS)
2913 help = '''\
2916 -h, --help show this help message and exit
2925 group.add_argument('--foo', action='store_true', help='FOO')
2926 group.add_argument('--spam', help='SPAM')
2927 group.add_argument('badger', nargs='*', default='X', help='BADGER')
2953 help = '''\
2959 -h, --help show this help message and exit
2969 parser.add_argument('-x', action='store_true', help='x help')
2971 group.add_argument('-a', action='store_true', help='a help')
2972 group.add_argument('-b', action='store_true', help='b help')
2973 parser.add_argument('-y', action='store_true', help='y help')
2974 group.add_argument('-c', action='store_true', help='c help')
2995 help = '''\
2998 -h, --help show this help message and exit
2999 -x x help
3000 -a a help
3001 -b b help
3002 -y y help
3003 -c c help
3015 mutex_group.add_argument('--bar', help='bar help')
3016 mutex_group.add_argument('--baz', help='baz help')
3034 help = '''\
3037 -h, --help show this help message and exit
3042 --bar BAR bar help
3043 --baz BAZ baz help
3051 parser.add_argument('x', help='x help')
3052 parser.add_argument('-y', action='store_true', help='y help')
3054 group.add_argument('a', nargs='?', help='a help')
3055 group.add_argument('-b', action='store_true', help='b help')
3056 group.add_argument('-c', action='store_true', help='c help')
3075 help = '''\
3078 x x help
3079 a a help
3082 -h, --help show this help message and exit
3083 -y y help
3084 -b b help
3085 -c c help
3119 help = '''\
3122 -h, --help show this help message and exit
3407 # add tests for {format,print}_{usage,help}
3409 ('help', 'stdout')]:
3417 """Make sure that argument help aligns when options are longer"""
3423 Sig('-x', action='store_true', help='X HELP'),
3424 Sig('--y', help='Y HELP'),
3425 Sig('foo', help='FOO HELP'),
3426 Sig('bar', help='BAR HELP'),
3432 help = usage + '''\
3441 -h, --help show this help message and exit
3474 help = usage + '''\
3485 -h, --help
3487 help
3507 """Make sure that argument help aligns when options are longer"""
3513 Sig('-x', action='store_true', help='X HELP'),
3514 Sig('--y', help='Y HELP'),
3515 Sig('foo', help='FOO HELP'),
3516 Sig('bar', help='BAR HELP'),
3520 Sig('baz', help='BAZ HELP'),
3521 Sig('-z', nargs='+', help='Z HELP')]),
3526 help = usage + '''\
3535 -h, --help show this help message and exit
3554 """Make sure that help aligns when arguments are longer"""
3558 Sig('-x', action='store_true', help='X HELP'),
3559 Sig('--y', help='Y HELP'),
3560 Sig('ekiekiekifekang', help='EKI HELP'),
3561 Sig('bar', help='BAR HELP'),
3567 help = usage + '''\
3576 -h, --help show this help message and exit
3595 Sig('-x', metavar='XX', help='oddly\n'
3596 ' formatted -x help'),
3597 Sig('y', metavar='yyy', help='normal y help'),
3605 help=' oddly \n'
3606 'formatted -a help \n'
3613 help = usage + '''\
3620 yyy normal y help
3623 -h, --help show this help message and exit
3624 -x XX oddly formatted -x help
3629 -a oddly formatted -a help again, so long that it should \
3641 Sig('-x', metavar='XX', help='XHH HX' * 20),
3642 Sig('y', metavar='yyy', help='YH YH' * 20),
3646 Sig('-a', action='store_true', help='AHHH HHA' * 10)]),
3651 help = usage + '''\
3663 -h, --help show this help message and exit
3682 Sig('-x', metavar='X' * 25, help='XH XH' * 20),
3683 Sig('y', metavar='y' * 25, help='YH YH' * 20),
3687 Sig('-a', metavar='A' * 25, help='AH AH' * 20),
3688 Sig('z', metavar='z' * 25, help='ZH ZH' * 20)]),
3693 help = usage + '''\
3706 -h, --help show this help message and exit
3735 Sig('-w', nargs='+', help='w'),
3736 Sig('-x', nargs='*', help='x'),
3737 Sig('a', help='a'),
3738 Sig('b', help='b', nargs=2),
3739 Sig('c', help='c', nargs='?'),
3740 Sig('--foo', help='Whether to foo', action=argparse.BooleanOptionalAction),
3741 Sig('--bar', help='Whether to bar', default=True,
3745 default=argparse.SUPPRESS, help='Bazz!'),
3749 Sig('-y', nargs='?', help='y'),
3750 Sig('-z', nargs=3, help='z'),
3751 Sig('d', help='d', nargs='*'),
3752 Sig('e', help='e', nargs='+'),
3762 help = usage + '''\
3770 -h, --help show this help message and exit
3797 help = usage + '''\
3803 -h, --help show this help message and exit
3816 Sig('-x', help='x'),
3817 Sig('a', help='a'),
3820 Sig('b', help='b'),
3821 Sig('-y', help='y'),
3827 help = usage + '''\
3855 help = usage + '''\
3862 -h, --help show this help message and exit
3889 help = usage + '''\
3896 -h, --help show this help message and exit
3920 help = usage + '''\
3951 help = usage + '''\
3959 -h, --help show this help message and exit
3986 help = usage + '''\
3994 -h, --help show this help message and exit
4022 help = usage + '''\
4030 -h, --help show this help message and exit
4053 help = usage + '''\
4056 -h, --help show this help message and exit
4078 help = usage + '''\
4089 """Test that variables are expanded properly in help messages"""
4094 help='x %(prog)s %(default)s %(type)s %%'),
4096 help='y %(prog)s %(default)s %(const)s'),
4098 help='foo %(prog)s %(default)s %(choices)s'),
4100 help='bar %(prog)s %(default)s %(dest)s'),
4101 Sig('spam', help='spam %(prog)s %(default)s'),
4102 Sig('badger', default=0.5, help='badger %(prog)s %(default)s'),
4106 Sig('-a', help='a %(prog)s %(default)s'),
4107 Sig('-b', default=-1, help='b %(prog)s %(default)s'),
4114 help = usage + '''\
4121 -h, --help show this help message and exit
4143 help = usage + '''\
4146 -h, --help show this help message and exit
4160 help = usage
4169 Sig('--foo', help='foo help'),
4170 Sig('spam', help='spam help'),
4173 help = '''\
4175 spam spam help
4178 -h, --help show this help message and exit
4179 --foo FOO foo help
4186 """Test that optional arguments can be suppressed in help messages"""
4190 Sig('--foo', help=argparse.SUPPRESS),
4191 Sig('spam', help='spam help'),
4197 help = usage + '''\
4200 spam spam help
4206 """Test that optional groups can be suppressed in help messages"""
4210 Sig('--foo', help='foo help'),
4211 Sig('spam', help='spam help'),
4214 (Sig('group'), [Sig('--bar', help=argparse.SUPPRESS)]),
4219 help = usage + '''\
4222 spam spam help
4225 -h, --help show this help message and exit
4226 --foo FOO foo help
4232 """Test that positional arguments can be suppressed in help messages"""
4236 Sig('--foo', help='foo help'),
4237 Sig('spam', help=argparse.SUPPRESS),
4243 help = usage + '''\
4246 -h, --help show this help message and exit
4247 --foo FOO foo help
4257 Sig('--foo', required=True, help='foo help'),
4263 help = usage + '''\
4266 -h, --help show this help message and exit
4267 --foo FOO foo help
4277 Sig('^^foo', action='store_true', help='foo help'),
4278 Sig(';b', ';;bar', help='bar help'),
4284 help = usage + '''\
4287 ^^foo foo help
4288 ;b BAR, ;;bar BAR bar help
4294 """Test that the --help argument can be suppressed help messages"""
4298 Sig('--foo', help='foo help'),
4299 Sig('spam', help='spam help'),
4305 help = usage + '''\
4308 spam spam help
4311 --foo FOO foo help
4317 """Test that no errors occur if no help is specified"""
4328 help = usage + '''\
4334 -h, --help show this help message and exit
4345 Sig('-w', help='w', nargs='+', metavar=('W1', 'W2')),
4346 Sig('-x', help='x', nargs='*', metavar=('X1', 'X2')),
4347 Sig('-y', help='y', nargs=3, metavar=('Y1', 'Y2', 'Y3')),
4348 Sig('-z', help='z', nargs='?', metavar=('Z1', )),
4355 help = usage + '''\
4358 -h, --help show this help message and exit
4378 Sig('--foo', help=' foo help should also\n'
4380 Sig('spam', help='spam help'),
4386 [Sig('--bar', help='bar help')]),
4391 help = usage + '''\
4399 spam spam help
4402 -h, --help show this help message and exit
4403 --foo FOO foo help should also
4411 --bar BAR bar help
4427 Sig('--foo', help=' foo help should not\n'
4429 Sig('spam', help='spam help'),
4435 [Sig('--bar', help='bar help')]),
4440 help = usage + '''\
4448 spam spam help
4451 -h, --help show this help message and exit
4452 --foo FOO foo help should not retain this odd formatting
4459 --bar BAR bar help
4472 Sig('--foo', help='foo help - oh and by the way, %(default)s'),
4473 Sig('--bar', action='store_true', help='bar help'),
4475 help='Whether to taz it', default=True),
4477 help='Whether to corge it', default=argparse.SUPPRESS),
4478 Sig('--quux', help="Set the quux", default=42),
4479 Sig('spam', help='spam help'),
4480 Sig('badger', nargs='?', default='wooden', help='badger help'),
4484 [Sig('--baz', type=int, default=42, help='baz help')]),
4491 help = usage + '''\
4496 spam spam help
4497 badger badger help (default: wooden)
4500 -h, --help show this help message and exit
4501 --foo FOO foo help - oh and by the way, None
4502 --bar bar help (default: False)
4510 --baz BAZ baz help (default: 42)
4515 """Test the default help for the version action"""
4523 help = usage + '''\
4528 -h, --help show this help message and exit
4535 """Test that the --version argument can be suppressed in help messages"""
4540 help=argparse.SUPPRESS),
4541 Sig('--foo', help='foo help'),
4542 Sig('spam', help='spam help'),
4548 help = usage + '''\
4551 spam spam help
4554 -h, --help show this help message and exit
4555 --foo FOO foo help
4560 """Test ordering of subcommands in help matches the code"""
4572 help = usage + '''\
4580 -h, --help show this help message and exit
4589 """Test ordering of subcommands in help matches the code"""
4594 subcommand_data = (('a', 'a subcommand help'),
4595 ('b', 'b subcommand help'),
4596 ('c', 'c subcommand help'),
4597 ('d', 'd subcommand help'),
4598 ('e', 'e subcommand help'),
4601 subparsers_signatures = [Sig(name=name, help=help)
4602 for name, help in subcommand_data]
4608 help = usage + '''\
4614 a a subcommand help
4615 b b subcommand help
4616 c c subcommand help
4617 d d subcommand help
4618 e e subcommand help
4621 -h, --help show this help message and exit
4645 help = usage + '''\
4653 -h, --help show this help message and exit
4805 help='FOO', metavar='BAR', dest='baz')
4811 self.assertEqual(action.help, 'FOO')
4839 parser.add_argument('-x', help='OLD X')
4840 parser.add_argument('-x', help='NEW X')
4845 -h, --help show this help message and exit
4855 -h, --help show this help message and exit
4879 """Test the help and version actions"""
4893 self.assertPrintHelpExit(parser, '--help')
4907 self.assertArgumentParserError(parser, '--help')
4920 self.assertArgumentParserError(parser, '--help')
4926 parser.add_argument('-x', action='help')
4946 self.assertPrintHelpExit(parser, format % '--help')
4970 help='HELP',
4975 "choices=[1, 2, 3], required=False, help='HELP', metavar='METAVAR')")
4987 help='H HH H',
4992 "required=True, help='H HH H', metavar='MV MV MV')" % float)
5324 group.add_argument('--foo', action='store_true', help='FOO')
5325 group.add_argument('--spam', help='SPAM')
5326 parser.add_argument('badger', nargs='*', default='X', help='BADGER')
5336 group.add_argument('--foo', action='store_true', help='FOO')
5337 group.add_argument('--spam', help='SPAM')
5338 group.add_argument('badger', nargs='*', default='X', help='BADGER')
5601 -h, --help show this help message and exit