Lines Matching defs:action

325         Sig('-x', action='store_true'),
326 Sig('-yyy', action='store_const', const=42),
424 Sig('--badger', action='store_true'),
442 Sig('--badger', action='store_true'),
461 Sig('-f', action='store_true'),
463 Sig('-baz', action='store_const', const=42),
481 Sig('+f', action='store_true'),
483 Sig('/baz', action='store_const', const=42),
503 Sig('+f', action='store_true'),
505 Sig('/baz', action='store_const', const=42),
523 Sig('-x', action='store_true'),
524 Sig('+y', action='store_true'),
525 Sig('+z', action='store_true'),
545 Sig('-v', '--verbose', '-n', '--noisy', action='store_true'),
692 """Tests an optional action that is required"""
705 """Tests the store action for an Optional"""
707 argument_signatures = [Sig('-x', action='store')]
716 """Tests the store_const action for an Optional"""
718 argument_signatures = [Sig('-y', action='store_const', const=object)]
727 """Tests the store_false action for an Optional"""
729 argument_signatures = [Sig('-z', action='store_false')]
738 """Tests the store_true action for an Optional"""
740 argument_signatures = [Sig('--apple', action='store_true')]
750 argument_signatures = [Sig('--foo', action=argparse.BooleanOptionalAction)]
764 parser.add_argument('--foo', const=True, action=argparse.BooleanOptionalAction)
772 Sig('--foo', required=True, action=argparse.BooleanOptionalAction)
781 """Tests the append action for an Optional"""
783 argument_signatures = [Sig('--baz', action='append')]
793 """Tests the append action for an Optional"""
795 argument_signatures = [Sig('--baz', action='append', default=['X'])]
808 Sig('-f', action='append_const'),
809 Sig('--foo', action='append_const'),
810 Sig('-b', action='store_const'),
811 Sig('--bar', action='store_const')
824 """Tests the append_const action for an Optional"""
827 Sig('-b', action='append_const', const=Exception),
828 Sig('-c', action='append', dest='b'),
839 """Tests the append_const action for an Optional"""
842 Sig('-b', action='append_const', const=Exception, default=['X']),
843 Sig('-c', action='append', dest='b'),
854 """Tests the count action for an Optional"""
856 argument_signatures = [Sig('-x', action='count')]
870 Sig('--fooble', action='store_true'),
887 Sig('--foodle', action='store_true'),
904 Sig('++foodle', action='store_true'),
921 Sig('-c', action='count'),
940 Sig('+c', action='count'),
1331 """Test the 'append' action"""
1334 Sig('spam', action='append'),
1335 Sig('spam', action='append', nargs=2),
1351 Sig('-4', dest='y', action='store_true'),
1367 Sig('-k4', dest='y', action='store_true'),
1404 Sig('-+-', dest='z', action='store_true'),
1479 Sig('--baz', action='store_true', default=argparse.SUPPRESS),
1499 Sig('--baz', action='store_true'),
1517 Sig('--version', action='version', version='1.0'),
1520 Sig('--baz', action='store_true'),
1950 """Test a user-defined option/argument action"""
2000 Sig('-s', dest='spam', action=OptionalAction,
2002 Sig('badger', action=PositionalAction,
2015 """Test a user-defined action supplied by registering it"""
2025 parser.register('action', 'my_action', self.MyAction)
2026 parser.add_argument('badger', action='my_action')
2034 Sig('--foo', action="extend", nargs="+", type=str),
2058 prefix_chars[0] * 2 + 'foo', action='store_true', help='foo help')
2063 '--foo', action='store_true', help='foo help')
2161 parser.add_argument('--foo', action='store_true')
2269 "--non-breaking", action='store_false',
2359 parser.add_argument('--foo', action='store_true', help='foo help')
2530 group.add_argument('-a', action='store_true')
2531 group.add_argument('-b', action='store_true')
2701 group1.add_argument('--foo', action='store_true')
2702 group1.add_argument('--bar', action='store_false')
2704 group2.add_argument('--soup', action='store_true')
2705 group2.add_argument('--nuts', action='store_false')
2857 group.add_argument('-y', action='store_false', help='y help')
2890 add('--spam', action='store_true', help=argparse.SUPPRESS)
2891 add('--badger', action='store_false', help=argparse.SUPPRESS)
2925 group.add_argument('--foo', action='store_true', help='FOO')
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')
3052 parser.add_argument('-y', action='store_true', help='y help')
3055 group.add_argument('-b', action='store_true', help='b help')
3056 group.add_argument('-c', action='store_true', help='c help')
3422 Sig('-v', '--version', action='version', version='0.1'),
3423 Sig('-x', action='store_true', help='X HELP'),
3512 Sig('-v', '--version', action='version', version='0.1'),
3513 Sig('-x', action='store_true', help='X HELP'),
3558 Sig('-x', action='store_true', help='X HELP'),
3604 [Sig('-a', action='store_true',
3646 Sig('-a', action='store_true', help='AHHH HHA' * 10)]),
3681 Sig('-v', '--version', action='version', version='V V' * 30),
3740 Sig('--foo', help='Whether to foo', action=argparse.BooleanOptionalAction),
3742 action=argparse.BooleanOptionalAction),
3743 Sig('-f', '--foobar', '--barfoo', action=argparse.BooleanOptionalAction),
3744 Sig('--bazz', action=argparse.BooleanOptionalAction,
4095 Sig('-y', action='store_const', default=42, const='XXX',
4277 Sig('^^foo', action='store_true', help='foo help'),
4473 Sig('--bar', action='store_true', help='bar help'),
4474 Sig('--taz', action=argparse.BooleanOptionalAction,
4476 Sig('--corge', action=argparse.BooleanOptionalAction,
4515 """Test the default help for the version action"""
4518 argument_signatures = [Sig('-V', '--version', action='version', version='3.6')]
4539 Sig('-v', '--version', action='version', version='1.0',
4563 argument_signatures = [Sig('-v', '--version', action='version', version='0.1')]
4592 argument_signatures = [Sig('-v', '--version', action='version', version='0.1')]
4685 for action in ['append', 'store']:
4686 self.assertTypeError(action=action)
4697 self.assertValueError('-x', action='foo')
4698 self.assertValueError('foo', action='baz')
4699 self.assertValueError('--foo', action=('store', 'append'))
4702 parser.add_argument("--foo", action="store-true")
4703 self.assertIn('unknown action', str(cm.exception))
4714 for action in ['store_const', 'store_true', 'store_false',
4718 self.assertTypeError('-x', action=action, **attrs)
4722 for action in ['store_true', 'store_false', 'count']:
4725 self.assertTypeError('-x', const='foo', action=action)
4728 self.assertTypeError('-x', nargs='*', action=action)
4731 for action in ['store', 'append']:
4734 self.assertValueError('-x', nargs=0, action=action)
4735 self.assertValueError('spam', nargs=0, action=action)
4740 nargs=nargs, action=action)
4742 nargs=nargs, action=action)
4745 for action in ['store_const', 'append_const']:
4748 self.assertTypeError('-x', nargs='+', action=action)
4751 self.assertTypeError('command', action='parsers')
4752 self.assertTypeError('command', action='parsers', prog='PROG')
4753 self.assertTypeError('command', action='parsers',
4782 action=Action, default=Success, const=Success)
4784 action=Action, default=Success, const=Success)
4794 action = parser.add_argument('--foo')
4795 self.assertEqual(action.dest, 'foo')
4796 action = parser.add_argument('-b', '--bar')
4797 self.assertEqual(action.dest, 'bar')
4798 action = parser.add_argument('-x', '-y')
4799 self.assertEqual(action.dest, 'x')
4803 action = parser.add_argument('--foo', nargs='?', const=42,
4806 self.assertEqual(action.nargs, '?')
4807 self.assertEqual(action.const, 42)
4808 self.assertEqual(action.default, 84)
4809 self.assertEqual(action.type, int)
4810 self.assertEqual(action.choices, [1, 2])
4811 self.assertEqual(action.help, 'FOO')
4812 self.assertEqual(action.metavar, 'BAR')
4813 self.assertEqual(action.dest, 'baz')
4891 parser.add_argument('-v', '--version', action='version', version='1.0')
4898 parser.add_argument('-v', '--version', action='version', version='%(prog)s 3.5')
4905 parser.add_argument('-v', '--version', action='version', version='1.0')
4912 parser.add_argument('-V', action='version', version='%(prog)s 3.7')
4926 parser.add_argument('-x', action='help')
4927 parser.add_argument('-y', action='version')
4935 parser.add_argument('--version', action='version', version='1.0')
4936 parser.add_argument('-x', action='store_true')
5224 # Issue #15906: When action='append', type=str, default=[] are
5229 default=[], action='append')
5267 parser.add_argument('--spam', action='store_false')
5324 group.add_argument('--foo', action='store_true', help='FOO')
5336 group.add_argument('--foo', action='store_true', help='FOO')