Skip to content

Commit 3ff6f8c

Browse files
author
Dylan Huang
committed
update
1 parent ebb85bf commit 3ff6f8c

File tree

2 files changed

+79
-335
lines changed

2 files changed

+79
-335
lines changed

eval_protocol/cli.py

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,14 @@
3232
preview_command = None # type: ignore[assignment]
3333

3434

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."""
3737
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."""
3843
parser.add_argument("--verbose", "-v", action="store_true", help="Enable verbose logging")
3944
parser.add_argument(
4045
"--profile",
@@ -500,11 +505,18 @@ def parse_args(args=None):
500505
help=argparse.SUPPRESS, # Hidden from help output
501506
)
502507
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)",
506512
)
507513

514+
return parser
515+
516+
517+
def parse_args(args=None):
518+
"""Parse command line arguments."""
519+
parser = build_parser()
508520
# Use parse_known_args to allow Hydra to handle its own arguments
509521
return parser.parse_known_args(args)
510522

0 commit comments

Comments
 (0)