Skip to content

Commit bc2d456

Browse files
committed
small cli fix
1 parent 486995a commit bc2d456

File tree

3 files changed

+21
-7
lines changed

3 files changed

+21
-7
lines changed

docs/reference/api-full.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Quick links:
1212
- [CLI Reference](cli.md)
1313
- [DSL Reference](dsl.md)
1414

15-
Generated from source code on: August 09, 2025 at 01:51 UTC
15+
Generated from source code on: August 09, 2025 at 02:14 UTC
1616

1717
Modules auto-discovered: 59
1818

docs/reference/cli.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ The CLI provides three primary commands:
2727

2828
**Global options** (must be placed before the command):
2929

30-
- `--verbose`, `-v`: Enable verbose (DEBUG) logging
31-
- `--quiet`, `-q`: Enable quiet mode (WARNING+ only)
30+
- `--verbose`, `-v`: Enable debug logging
31+
- `--quiet`: Suppress console output (logs only)
3232

3333
### Quick Start
3434

ngraph/cli.py

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -528,17 +528,26 @@ def main(argv: Optional[List[str]] = None) -> None:
528528
argv: Optional list of command-line arguments. If ``None``, ``sys.argv``
529529
is used.
530530
"""
531-
parser = argparse.ArgumentParser(prog="ngraph")
531+
parser = argparse.ArgumentParser(
532+
prog="ngraph",
533+
description="Run and analyze network scenarios.",
534+
)
532535

533536
# Global options
534537
parser.add_argument(
535-
"--verbose", "-v", action="store_true", help="Enable verbose (DEBUG) logging"
538+
"--verbose", "-v", action="store_true", help="Enable debug logging"
536539
)
537540
parser.add_argument(
538-
"--quiet", "-q", action="store_true", help="Enable quiet mode (WARNING+ only)"
541+
"--quiet", action="store_true", help="Suppress console output (logs only)"
539542
)
540543

541-
subparsers = parser.add_subparsers(dest="command", required=True)
544+
subparsers = parser.add_subparsers(
545+
dest="command",
546+
required=True,
547+
title="Available commands",
548+
metavar="{run,inspect,report}",
549+
help="Available commands",
550+
)
542551

543552
# Run command
544553
run_parser = subparsers.add_parser("run", help="Run a scenario")
@@ -614,6 +623,11 @@ def main(argv: Optional[List[str]] = None) -> None:
614623
help="Include code cells in HTML output (default: report without code)",
615624
)
616625

626+
# If no arguments are provided, show help and exit cleanly
627+
if not argv:
628+
parser.print_help()
629+
raise SystemExit(0)
630+
617631
args = parser.parse_args(argv)
618632

619633
# Configure logging based on arguments

0 commit comments

Comments
 (0)