MCPcopy Create free account
hub / github.com/python/cpython / create_cli

Function create_cli

Tools/clinic/libclinic/cli.py:89–119  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

87
88
89def create_cli() -> argparse.ArgumentParser:
90 cmdline = argparse.ArgumentParser(
91 prog="clinic.py",
92 description="""Preprocessor for CPython C files.
93
94The purpose of the Argument Clinic is automating all the boilerplate involved
95with writing argument parsing code for builtins and providing introspection
96signatures ("docstrings") for CPython builtins.
97
98For more information see https://devguide.python.org/development-tools/clinic/""")
99 cmdline.add_argument("-f", "--force", action='store_true',
100 help="force output regeneration")
101 cmdline.add_argument("-o", "--output", type=str,
102 help="redirect file output to OUTPUT")
103 cmdline.add_argument("-v", "--verbose", action='store_true',
104 help="enable verbose mode")
105 cmdline.add_argument("--converters", action='store_true',
106 help=("print a list of all supported converters "
107 "and return converters"))
108 cmdline.add_argument("--make", action='store_true',
109 help="walk --srcdir to run over all relevant files")
110 cmdline.add_argument("--srcdir", type=str, default=os.curdir,
111 help="the directory tree to walk in --make mode")
112 cmdline.add_argument("--exclude", type=str, action="append",
113 help=("a file to exclude in --make mode; "
114 "can be given multiple times"))
115 cmdline.add_argument("--limited", dest="limited_capi", action='store_true',
116 help="use the Limited C API")
117 cmdline.add_argument("filename", metavar="FILE", type=str, nargs="*",
118 help="the list of files to process")
119 return cmdline
120
121
122def run_clinic(parser: argparse.ArgumentParser, ns: argparse.Namespace) -> None:

Callers 1

mainFunction · 0.85

Calls 1

add_argumentMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…