()
| 87 | |
| 88 | |
| 89 | def create_cli() -> argparse.ArgumentParser: |
| 90 | cmdline = argparse.ArgumentParser( |
| 91 | prog="clinic.py", |
| 92 | description="""Preprocessor for CPython C files. |
| 93 | |
| 94 | The purpose of the Argument Clinic is automating all the boilerplate involved |
| 95 | with writing argument parsing code for builtins and providing introspection |
| 96 | signatures ("docstrings") for CPython builtins. |
| 97 | |
| 98 | For 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 | |
| 122 | def run_clinic(parser: argparse.ArgumentParser, ns: argparse.Namespace) -> None: |
no test coverage detected
searching dependent graphs…