MCPcopy Index your code
hub / github.com/python/cpython / parse_args

Function parse_args

Lib/test/bisect_cmd.py:95–112  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

93
94
95def parse_args():
96 parser = argparse.ArgumentParser()
97 parser.add_argument('-i', '--input',
98 help='Test names produced by --list-tests written '
99 'into a file. If not set, run --list-tests')
100 parser.add_argument('-o', '--output',
101 help='Result of the bisection')
102 parser.add_argument('-n', '--max-tests', type=int, default=1,
103 help='Maximum number of tests to stop the bisection '
104 '(default: 1)')
105 parser.add_argument('-N', '--max-iter', type=int, default=100,
106 help='Maximum number of bisection iterations '
107 '(default: 100)')
108 # FIXME: document that following arguments are test arguments
109
110 args, test_args = parser.parse_known_args()
111 args.test_args = test_args
112 return args
113
114
115def main():

Callers 5

mainFunction · 0.70
stderr_to_parser_errorFunction · 0.70
_test_mutex_abMethod · 0.70

Calls 2

parse_known_argsMethod · 0.95
add_argumentMethod · 0.45

Tested by 4

stderr_to_parser_errorFunction · 0.56
_test_mutex_abMethod · 0.56

Used in the wild real call sites across dependent graphs

searching dependent graphs…