|
14 | 14 |
|
15 | 15 |
|
16 | 16 | def _parse_args() -> argparse.Namespace: |
17 | | - p = argparse.ArgumentParser() |
18 | | - p.add_argument("--generate", type=lambda x: x.split(","), default=["dbscheme", "ql"]) |
19 | | - p.add_argument("--verbose", "-v", action="store_true") |
20 | | - p.add_argument("--swift-dir", type=_abspath, default=paths.swift_dir) |
21 | | - p.add_argument("--schema", type=_abspath, default=paths.swift_dir / "codegen/schema.yml") |
22 | | - p.add_argument("--dbscheme", type=_abspath, default=paths.swift_dir / "ql/lib/swift.dbscheme") |
23 | | - p.add_argument("--ql-output", type=_abspath, default=paths.swift_dir / "ql/lib/codeql/swift/generated") |
24 | | - p.add_argument("--ql-stub-output", type=_abspath, default=paths.swift_dir / "ql/lib/codeql/swift/elements") |
25 | | - p.add_argument("--ql-format", action="store_true", default=True) |
26 | | - p.add_argument("--no-ql-format", action="store_false", dest="ql_format") |
27 | | - p.add_argument("--codeql-binary", default="codeql") |
28 | | - p.add_argument("--cpp-output", type=_abspath) |
29 | | - p.add_argument("--cpp-namespace", default="codeql") |
30 | | - p.add_argument("--trap-affix", default="Trap") |
31 | | - p.add_argument("--cpp-include-dir", default="swift/extractor/trap") |
| 17 | + p = argparse.ArgumentParser(description="Code generation suite") |
| 18 | + p.add_argument("--generate", type=lambda x: x.split(","), default=["dbscheme", "ql"], |
| 19 | + help="specify what targets to generate as a comma separated list, choosing among dbscheme, ql, trap " |
| 20 | + "and cpp") |
| 21 | + p.add_argument("--verbose", "-v", action="store_true", help="print more information") |
| 22 | + p.add_argument("--swift-dir", type=_abspath, default=paths.swift_dir, |
| 23 | + help="the directory that should be regarded as the root of the swift codebase. Used to compute QL " |
| 24 | + "imports and in some comments (default %(default)s)") |
| 25 | + p.add_argument("--schema", type=_abspath, default=paths.swift_dir / "codegen/schema.yml", |
| 26 | + help="input schema file (default %(default)s)") |
| 27 | + p.add_argument("--dbscheme", type=_abspath, default=paths.swift_dir / "ql/lib/swift.dbscheme", |
| 28 | + help="output file for dbscheme generation, input file for trap generation (default %(default)s)") |
| 29 | + p.add_argument("--ql-output", type=_abspath, default=paths.swift_dir / "ql/lib/codeql/swift/generated", |
| 30 | + help="output directory for generated QL files (default %(default)s)") |
| 31 | + p.add_argument("--ql-stub-output", type=_abspath, default=paths.swift_dir / "ql/lib/codeql/swift/elements", |
| 32 | + help="output directory for QL stub/customization files (default %(default)s). Defines also the " |
| 33 | + "generated qll file importing every class file") |
| 34 | + p.add_argument("--ql-format", action="store_true", default=True, |
| 35 | + help="use codeql to autoformat QL files (which is the default)") |
| 36 | + p.add_argument("--no-ql-format", action="store_false", dest="ql_format", help="do not format QL files") |
| 37 | + p.add_argument("--codeql-binary", default="codeql", help="command to use for QL formatting (default %(default)s)") |
| 38 | + p.add_argument("--cpp-output", type=_abspath, |
| 39 | + help="output directory for generated C++ files, required if trap or cpp is provided to --generate") |
32 | 40 | return p.parse_args() |
33 | 41 |
|
34 | 42 |
|
|
0 commit comments