Lines Matching refs:nargs

539     argument_signatures = [Sig('-x', nargs=1)]
550 argument_signatures = [Sig('-x', nargs=3)]
562 Sig('-w', nargs='?'),
563 Sig('-x', nargs='?', const=42),
564 Sig('-y', nargs='?', default='spam'),
565 Sig('-z', nargs='?', type=int, const='42', default='84'),
585 Sig('-x', nargs='*'),
586 Sig('-y', nargs='*', default='spam'),
604 Sig('-x', nargs='+'),
605 Sig('-y', nargs='+', default='spam'),
806 argument_signatures = [Sig('foo', nargs=1)]
816 argument_signatures = [Sig('foo', nargs=2)]
826 argument_signatures = [Sig('foo', nargs='*')]
838 argument_signatures = [Sig('foo', nargs='*', default='bar')]
850 argument_signatures = [Sig('foo', nargs='+')]
861 argument_signatures = [Sig('foo', nargs='?')]
872 argument_signatures = [Sig('foo', nargs='?', default=42)]
886 Sig('foo', nargs='?', type=int, default='42'),
908 argument_signatures = [Sig('foo'), Sig('bar', nargs=1)]
918 argument_signatures = [Sig('foo', nargs=2), Sig('bar')]
928 argument_signatures = [Sig('foo'), Sig('bar', nargs='*')]
940 argument_signatures = [Sig('foo'), Sig('bar', nargs='+')]
951 argument_signatures = [Sig('foo'), Sig('bar', nargs='?')]
962 argument_signatures = [Sig('foo', nargs='*'), Sig('bar')]
974 argument_signatures = [Sig('foo', nargs='+'), Sig('bar')]
985 argument_signatures = [Sig('foo', nargs='?', default=42), Sig('bar')]
996 argument_signatures = [Sig('foo', nargs=2), Sig('bar', nargs='*')]
1007 argument_signatures = [Sig('foo', nargs=2), Sig('bar', nargs='+')]
1017 argument_signatures = [Sig('foo', nargs=2), Sig('bar', nargs='?')]
1028 argument_signatures = [Sig('foo', nargs='*'), Sig('bar', nargs=1)]
1040 argument_signatures = [Sig('foo', nargs='+'), Sig('bar', nargs=1)]
1051 argument_signatures = [Sig('foo', nargs='?'), Sig('bar', nargs=1)]
1064 Sig('bar', nargs='*'),
1065 Sig('baz', nargs=1),
1079 Sig('bar', nargs='+'),
1080 Sig('baz', nargs=1),
1094 Sig('bar', nargs='?', default=0.625),
1095 Sig('baz', nargs=1),
1108 Sig('foo', nargs='?'),
1109 Sig('bar', nargs='?', default=42),
1122 argument_signatures = [Sig('foo', nargs='?'), Sig('bar', nargs='*')]
1135 argument_signatures = [Sig('foo', nargs='?'), Sig('bar', nargs='+')]
1171 Sig('spam', action='append', nargs=2),
1186 Sig('x', nargs='?'),
1202 Sig('x', nargs='?'),
1218 Sig('x', nargs='?'),
1238 Sig('-', dest='x', nargs='?', const='badger'),
1256 argument_signatures = [Sig('-x', nargs='*'), Sig('y', nargs='*')]
1272 argument_signatures = [Sig('x'), Sig('y', nargs='...'), Sig('-z')]
1288 Sig('z', nargs='*'),
1313 Sig('foo', nargs='?', default=argparse.SUPPRESS),
1314 Sig('bar', nargs='*', default=argparse.SUPPRESS),
1333 Sig('foo', nargs='?'),
1334 Sig('bar', nargs='*'),
1354 Sig('foo', nargs='?'),
1355 Sig('bar', nargs='*'),
1390 Sig('y', nargs='+'),
1427 Sig('y', nargs='+'),
1764 type=int, nargs='?', default=2),
1845 parser2.add_argument('z', type=complex, nargs='*', help='z help')
1853 parser3.add_argument('u', nargs='...', help='u help')
2388 raises(ValueError, add_argument, 'bar', nargs='+')
2389 raises(ValueError, add_argument, 'bar', nargs=1)
2390 raises(ValueError, add_argument, 'bar', nargs=argparse.PARSER)
2466 group.add_argument('--baz', nargs='?', const='Z', help='baz help')
2614 group.add_argument('badger', nargs='*', default='X', help='BADGER')
2741 group.add_argument('a', nargs='?', help='a help')
2890 parser.add_argument('y', nargs='?')
2891 parser.add_argument('z', nargs='?', default='ZZ')
2908 group.add_argument('y', nargs='?')
2909 group.add_argument('z', nargs='?', default='ZZ')
3159 Sig('-z', nargs='+', help='Z HELP')]),
3373 Sig('-w', nargs='+', help='w'),
3374 Sig('-x', nargs='*', help='x'),
3376 Sig('b', help='b', nargs=2),
3377 Sig('c', help='c', nargs='?'),
3381 Sig('-y', nargs='?', help='y'),
3382 Sig('-z', nargs=3, help='z'),
3383 Sig('d', help='d', nargs='*'),
3384 Sig('e', help='e', nargs='+'),
3948 Sig('-w', help='w', nargs='+', metavar=('W1', 'W2')),
3949 Sig('-x', help='x', nargs='*', metavar=('X1', 'X2')),
3950 Sig('-y', help='y', nargs=3, metavar=('Y1', 'Y2', 'Y3')),
3951 Sig('-z', help='z', nargs='?', metavar=('Z1', )),
4078 Sig('badger', nargs='?', default='wooden', help='badger help'),
4310 for attrs in [dict(type=int), dict(nargs='+'),
4322 self.assertTypeError('-x', nargs='*', action=action)
4328 self.assertValueError('-x', nargs=0, action=action)
4329 self.assertValueError('spam', nargs=0, action=action)
4332 for nargs in [1, '*', '+']:
4334 nargs=nargs, action=action)
4336 nargs=nargs, action=action)
4342 self.assertTypeError('-x', nargs='+', action=action)
4397 action = parser.add_argument('--foo', nargs='?', const=42,
4400 self.assertEqual(action.nargs, '?')
4547 nargs='+',
4563 nargs='?',
4696 parser.add_argument('need_one', type=str, nargs='+')
4721 parser.add_argument('--opt_opt', type=bool, nargs='?',
4739 parser.add_argument('optional_positional', nargs='?', default='eggs')
4845 parser.add_argument('-v', nargs='?', const=1, type=int)
4865 parser.add_argument('rest', nargs='*', type=int)
4891 parser.add_argument('y', nargs='...')
4905 parser.add_argument('badger', nargs='*', default='X', help='BADGER')
4917 group.add_argument('badger', nargs='*', default='X', help='BADGER')
4949 def do_test_no_exception(self, nargs, metavar): argument
4951 parser.add_argument("--foo", nargs=nargs, metavar=metavar)
4953 def do_test_exception(self, nargs, metavar): argument
4956 parser.add_argument("--foo", nargs=nargs, metavar=metavar)
4962 self.do_test_no_exception(nargs=None, metavar="1")
4965 self.do_test_exception(nargs=None, metavar=tuple())
4968 self.do_test_no_exception(nargs=None, metavar=("1",))
4971 self.do_test_exception(nargs=None, metavar=("1", "2"))
4974 self.do_test_exception(nargs=None, metavar=("1", "2", "3"))
4979 self.do_test_no_exception(nargs="?", metavar="1")
4982 self.do_test_exception(nargs="?", metavar=tuple())
4985 self.do_test_no_exception(nargs="?", metavar=("1",))
4988 self.do_test_exception(nargs="?", metavar=("1", "2"))
4991 self.do_test_exception(nargs="?", metavar=("1", "2", "3"))
4996 self.do_test_no_exception(nargs="*", metavar="1")
4999 self.do_test_exception(nargs="*", metavar=tuple())
5002 self.do_test_exception(nargs="*", metavar=("1",))
5005 self.do_test_no_exception(nargs="*", metavar=("1", "2"))
5008 self.do_test_exception(nargs="*", metavar=("1", "2", "3"))
5013 self.do_test_no_exception(nargs="+", metavar="1")
5016 self.do_test_exception(nargs="+", metavar=tuple())
5019 self.do_test_exception(nargs="+", metavar=("1",))
5022 self.do_test_no_exception(nargs="+", metavar=("1", "2"))
5025 self.do_test_exception(nargs="+", metavar=("1", "2", "3"))
5030 self.do_test_no_exception(nargs="...", metavar="1")
5033 self.do_test_no_exception(nargs="...", metavar=tuple())
5036 self.do_test_no_exception(nargs="...", metavar=("1",))
5039 self.do_test_no_exception(nargs="...", metavar=("1", "2"))
5042 self.do_test_no_exception(nargs="...", metavar=("1", "2", "3"))
5047 self.do_test_no_exception(nargs="A...", metavar="1")
5050 self.do_test_exception(nargs="A...", metavar=tuple())
5053 self.do_test_no_exception(nargs="A...", metavar=("1",))
5056 self.do_test_exception(nargs="A...", metavar=("1", "2"))
5059 self.do_test_exception(nargs="A...", metavar=("1", "2", "3"))
5064 self.do_test_no_exception(nargs=1, metavar="1")
5067 self.do_test_exception(nargs=1, metavar=tuple())
5070 self.do_test_no_exception(nargs=1, metavar=("1",))
5073 self.do_test_exception(nargs=1, metavar=("1", "2"))
5076 self.do_test_exception(nargs=1, metavar=("1", "2", "3"))
5081 self.do_test_no_exception(nargs=2, metavar="1")
5084 self.do_test_exception(nargs=2, metavar=tuple())
5087 self.do_test_exception(nargs=2, metavar=("1",))
5090 self.do_test_no_exception(nargs=2, metavar=("1", "2"))
5093 self.do_test_exception(nargs=2, metavar=("1", "2", "3"))
5098 self.do_test_no_exception(nargs=3, metavar="1")
5101 self.do_test_exception(nargs=3, metavar=tuple())
5104 self.do_test_exception(nargs=3, metavar=("1",))
5107 self.do_test_exception(nargs=3, metavar=("1", "2"))
5110 self.do_test_no_exception(nargs=3, metavar=("1", "2", "3"))