Lines Matching refs:nargs

553     argument_signatures = [Sig('-x', nargs=1)]
564 argument_signatures = [Sig('-x', nargs=3)]
576 Sig('-w', nargs='?'),
577 Sig('-x', nargs='?', const=42),
578 Sig('-y', nargs='?', default='spam'),
579 Sig('-z', nargs='?', type=int, const='42', default='84'),
599 Sig('-x', nargs='*'),
600 Sig('-y', nargs='*', default='spam'),
618 Sig('-x', nargs='+'),
619 Sig('-y', nargs='+', default='spam'),
787 argument_signatures = [Sig('foo', nargs=1)]
797 argument_signatures = [Sig('foo', nargs=2)]
807 argument_signatures = [Sig('foo', nargs='*')]
819 argument_signatures = [Sig('foo', nargs='*', default='bar')]
831 argument_signatures = [Sig('foo', nargs='+')]
842 argument_signatures = [Sig('foo', nargs='?')]
853 argument_signatures = [Sig('foo', nargs='?', default=42)]
867 Sig('foo', nargs='?', type=int, default='42'),
889 argument_signatures = [Sig('foo'), Sig('bar', nargs=1)]
899 argument_signatures = [Sig('foo', nargs=2), Sig('bar')]
909 argument_signatures = [Sig('foo'), Sig('bar', nargs='*')]
921 argument_signatures = [Sig('foo'), Sig('bar', nargs='+')]
932 argument_signatures = [Sig('foo'), Sig('bar', nargs='?')]
943 argument_signatures = [Sig('foo', nargs='*'), Sig('bar')]
955 argument_signatures = [Sig('foo', nargs='+'), Sig('bar')]
966 argument_signatures = [Sig('foo', nargs='?', default=42), Sig('bar')]
977 argument_signatures = [Sig('foo', nargs=2), Sig('bar', nargs='*')]
988 argument_signatures = [Sig('foo', nargs=2), Sig('bar', nargs='+')]
998 argument_signatures = [Sig('foo', nargs=2), Sig('bar', nargs='?')]
1009 argument_signatures = [Sig('foo', nargs='*'), Sig('bar', nargs=1)]
1021 argument_signatures = [Sig('foo', nargs='+'), Sig('bar', nargs=1)]
1032 argument_signatures = [Sig('foo', nargs='?'), Sig('bar', nargs=1)]
1045 Sig('bar', nargs='*'),
1046 Sig('baz', nargs=1),
1060 Sig('bar', nargs='+'),
1061 Sig('baz', nargs=1),
1075 Sig('bar', nargs='?', default=0.625),
1076 Sig('baz', nargs=1),
1089 Sig('foo', nargs='?'),
1090 Sig('bar', nargs='?', default=42),
1103 argument_signatures = [Sig('foo', nargs='?'), Sig('bar', nargs='*')]
1116 argument_signatures = [Sig('foo', nargs='?'), Sig('bar', nargs='+')]
1152 Sig('spam', action='append', nargs=2),
1167 Sig('x', nargs='?'),
1183 Sig('x', nargs='?'),
1199 Sig('x', nargs='?'),
1219 Sig('-', dest='x', nargs='?', const='badger'),
1237 argument_signatures = [Sig('-x', nargs='*'), Sig('y', nargs='*')]
1253 argument_signatures = [Sig('x'), Sig('y', nargs='...'), Sig('-z')]
1269 Sig('z', nargs='*'),
1294 Sig('foo', nargs='?', default=argparse.SUPPRESS),
1295 Sig('bar', nargs='*', default=argparse.SUPPRESS),
1314 Sig('foo', nargs='?'),
1315 Sig('bar', nargs='*'),
1334 Sig('foo', nargs='?'),
1335 Sig('bar', nargs='*'),
1370 Sig('y', nargs='+'),
1407 Sig('y', nargs='+'),
1712 type=int, nargs='?', default=2),
1784 parser2.add_argument('z', type=complex, nargs='*', help='z help')
1792 parser3.add_argument('u', nargs='...', help='u help')
2239 raises(ValueError, add_argument, 'bar', nargs='+')
2240 raises(ValueError, add_argument, 'bar', nargs=1)
2241 raises(ValueError, add_argument, 'bar', nargs=argparse.PARSER)
2317 group.add_argument('--baz', nargs='?', const='Z', help='baz help')
2465 group.add_argument('badger', nargs='*', default='X', help='BADGER')
2592 group.add_argument('a', nargs='?', help='a help')
2741 parser.add_argument('y', nargs='?')
2742 parser.add_argument('z', nargs='?', default='ZZ')
2759 group.add_argument('y', nargs='?')
2760 group.add_argument('z', nargs='?', default='ZZ')
3018 Sig('-z', nargs='+', help='Z HELP')]),
3232 Sig('-w', nargs='+', help='w'),
3233 Sig('-x', nargs='*', help='x'),
3235 Sig('b', help='b', nargs=2),
3236 Sig('c', help='c', nargs='?'),
3240 Sig('-y', nargs='?', help='y'),
3241 Sig('-z', nargs=3, help='z'),
3242 Sig('d', help='d', nargs='*'),
3243 Sig('e', help='e', nargs='+'),
3834 Sig('-w', help='w', nargs='+', metavar=('W1', 'W2')),
3835 Sig('-x', help='x', nargs='*', metavar=('X1', 'X2')),
3836 Sig('-y', help='y', nargs=3, metavar=('Y1', 'Y2', 'Y3')),
3837 Sig('-z', help='z', nargs='?', metavar=('Z1', )),
3964 Sig('badger', nargs='?', default='wooden', help='badger help'),
4146 for attrs in [dict(type=int), dict(nargs='+'),
4158 self.assertTypeError('-x', nargs='*', action=action)
4164 self.assertValueError('-x', nargs=0, action=action)
4165 self.assertValueError('spam', nargs=0, action=action)
4168 for nargs in [1, '*', '+']:
4170 nargs=nargs, action=action)
4172 nargs=nargs, action=action)
4178 self.assertTypeError('-x', nargs='+', action=action)
4233 action = parser.add_argument('--foo', nargs='?', const=42,
4236 self.assertEqual(action.nargs, '?')
4393 nargs='+',
4409 nargs='?',
4619 parser.add_argument('-v', nargs='?', const=1, type=int)
4636 def do_test_no_exception(self, nargs, metavar): argument
4638 parser.add_argument("--foo", nargs=nargs, metavar=metavar)
4640 def do_test_exception(self, nargs, metavar): argument
4643 parser.add_argument("--foo", nargs=nargs, metavar=metavar)
4649 self.do_test_no_exception(nargs=None, metavar="1")
4652 self.do_test_exception(nargs=None, metavar=tuple())
4655 self.do_test_no_exception(nargs=None, metavar=("1",))
4658 self.do_test_exception(nargs=None, metavar=("1", "2"))
4661 self.do_test_exception(nargs=None, metavar=("1", "2", "3"))
4666 self.do_test_no_exception(nargs="?", metavar="1")
4669 self.do_test_exception(nargs="?", metavar=tuple())
4672 self.do_test_no_exception(nargs="?", metavar=("1",))
4675 self.do_test_exception(nargs="?", metavar=("1", "2"))
4678 self.do_test_exception(nargs="?", metavar=("1", "2", "3"))
4683 self.do_test_no_exception(nargs="*", metavar="1")
4686 self.do_test_exception(nargs="*", metavar=tuple())
4689 self.do_test_exception(nargs="*", metavar=("1",))
4692 self.do_test_no_exception(nargs="*", metavar=("1", "2"))
4695 self.do_test_exception(nargs="*", metavar=("1", "2", "3"))
4700 self.do_test_no_exception(nargs="+", metavar="1")
4703 self.do_test_exception(nargs="+", metavar=tuple())
4706 self.do_test_exception(nargs="+", metavar=("1",))
4709 self.do_test_no_exception(nargs="+", metavar=("1", "2"))
4712 self.do_test_exception(nargs="+", metavar=("1", "2", "3"))
4717 self.do_test_no_exception(nargs="...", metavar="1")
4720 self.do_test_no_exception(nargs="...", metavar=tuple())
4723 self.do_test_no_exception(nargs="...", metavar=("1",))
4726 self.do_test_no_exception(nargs="...", metavar=("1", "2"))
4729 self.do_test_no_exception(nargs="...", metavar=("1", "2", "3"))
4734 self.do_test_no_exception(nargs="A...", metavar="1")
4737 self.do_test_exception(nargs="A...", metavar=tuple())
4740 self.do_test_no_exception(nargs="A...", metavar=("1",))
4743 self.do_test_exception(nargs="A...", metavar=("1", "2"))
4746 self.do_test_exception(nargs="A...", metavar=("1", "2", "3"))
4751 self.do_test_no_exception(nargs=1, metavar="1")
4754 self.do_test_exception(nargs=1, metavar=tuple())
4757 self.do_test_no_exception(nargs=1, metavar=("1",))
4760 self.do_test_exception(nargs=1, metavar=("1", "2"))
4763 self.do_test_exception(nargs=1, metavar=("1", "2", "3"))
4768 self.do_test_no_exception(nargs=2, metavar="1")
4771 self.do_test_exception(nargs=2, metavar=tuple())
4774 self.do_test_exception(nargs=2, metavar=("1",))
4777 self.do_test_no_exception(nargs=2, metavar=("1", "2"))
4780 self.do_test_exception(nargs=2, metavar=("1", "2", "3"))
4785 self.do_test_no_exception(nargs=3, metavar="1")
4788 self.do_test_exception(nargs=3, metavar=tuple())
4791 self.do_test_exception(nargs=3, metavar=("1",))
4794 self.do_test_exception(nargs=3, metavar=("1", "2"))
4797 self.do_test_no_exception(nargs=3, metavar=("1", "2", "3"))