|
32 | 32 | preview_command = None # type: ignore[assignment] |
33 | 33 |
|
34 | 34 |
|
35 | | -def parse_args(args=None): |
36 | | - """Parse command line arguments""" |
| 35 | +def build_parser() -> argparse.ArgumentParser: |
| 36 | + """Build and return the argument parser for the CLI.""" |
37 | 37 | parser = argparse.ArgumentParser(description="eval-protocol: Tools for evaluation and reward modeling") |
| 38 | + return _configure_parser(parser) |
| 39 | + |
| 40 | + |
| 41 | +def _configure_parser(parser: argparse.ArgumentParser) -> argparse.ArgumentParser: |
| 42 | + """Configure all arguments and subparsers on the given parser.""" |
38 | 43 | parser.add_argument("--verbose", "-v", action="store_true", help="Enable verbose logging") |
39 | 44 | parser.add_argument( |
40 | 45 | "--profile", |
@@ -500,11 +505,18 @@ def parse_args(args=None): |
500 | 505 | help=argparse.SUPPRESS, # Hidden from help output |
501 | 506 | ) |
502 | 507 | export_docs_parser.add_argument( |
503 | | - "--output-dir", |
504 | | - default="./docs/cli-reference", |
505 | | - help="Directory to write markdown files to (default: ./docs/cli-reference)", |
| 508 | + "--output", |
| 509 | + "-o", |
| 510 | + default="./docs/cli-reference.md", |
| 511 | + help="Output markdown file path (default: ./docs/cli-reference.md)", |
506 | 512 | ) |
507 | 513 |
|
| 514 | + return parser |
| 515 | + |
| 516 | + |
| 517 | +def parse_args(args=None): |
| 518 | + """Parse command line arguments.""" |
| 519 | + parser = build_parser() |
508 | 520 | # Use parse_known_args to allow Hydra to handle its own arguments |
509 | 521 | return parser.parse_known_args(args) |
510 | 522 |
|
|
0 commit comments