Lines Matching refs:getopt

8 import getopt
19 self.assertRaises(getopt.GetoptError, *args, **kwargs)
22 self.assertTrue(getopt.short_has_arg('a', 'a:'))
23 self.assertFalse(getopt.short_has_arg('a', 'a'))
24 self.assertError(getopt.short_has_arg, 'a', 'b')
27 has_arg, option = getopt.long_has_args('abc', ['abc='])
31 has_arg, option = getopt.long_has_args('abc', ['abc'])
35 has_arg, option = getopt.long_has_args('abc', ['abcd'])
39 self.assertError(getopt.long_has_args, 'abc', ['def'])
40 self.assertError(getopt.long_has_args, 'abc', [])
41 self.assertError(getopt.long_has_args, 'abc', ['abcd','abcde'])
44 opts, args = getopt.do_shorts([], 'a', 'a', [])
48 opts, args = getopt.do_shorts([], 'a1', 'a:', [])
52 #opts, args = getopt.do_shorts([], 'a=1', 'a:', [])
56 opts, args = getopt.do_shorts([], 'a', 'a:', ['1'])
60 opts, args = getopt.do_shorts([], 'a', 'a:', ['1', '2'])
64 self.assertError(getopt.do_shorts, [], 'a1', 'a', [])
65 self.assertError(getopt.do_shorts, [], 'a', 'a:', [])
68 opts, args = getopt.do_longs([], 'abc', ['abc'], [])
72 opts, args = getopt.do_longs([], 'abc=1', ['abc='], [])
76 opts, args = getopt.do_longs([], 'abc=1', ['abcd='], [])
80 opts, args = getopt.do_longs([], 'abc', ['ab', 'abc', 'abcd'], [])
87 opts, args = getopt.do_longs([], 'foo=42', ['foo-bar', 'foo=',], [])
91 self.assertError(getopt.do_longs, [], 'abc=1', ['abc'], [])
92 self.assertError(getopt.do_longs, [], 'abc', ['abc='], [])
101 opts, args = getopt.getopt(cmdline, 'a:b', ['alpha=', 'beta'])
106 # accounted for in the code that calls getopt().
109 self.assertError(getopt.getopt, cmdline, 'a:b', ['alpha', 'beta'])
116 opts, args = getopt.gnu_getopt(cmdline, 'ab:', ['alpha', 'beta='])
122 opts, args = getopt.gnu_getopt(['-a', '-', '-b', '-'], 'ab:', [])
127 opts, args = getopt.gnu_getopt(cmdline, '+ab:', ['alpha', 'beta='])
133 opts, args = getopt.gnu_getopt(cmdline, 'ab:', ['alpha', 'beta='])
144 >>> import getopt
148 >>> optlist, args = getopt.getopt(args, 'abc:d:')
161 >>> optlist, args = getopt.getopt(args, 'x', [
174 longopts, shortopts = getopt.getopt(['--help='], '', ['help='])
176 longopts, shortopts = getopt.getopt(['--help=x'], '', ['help='])
178 self.assertRaises(getopt.GetoptError, getopt.getopt, ['--help='], '', ['help'])