Skip to content

Commit 4ee0121

Browse files
committed
Fix parser, splitting back out to seperate interactive mode subcommand
1 parent 4f60013 commit 4ee0121

File tree

2 files changed

+20
-23
lines changed

2 files changed

+20
-23
lines changed

src/hpc_multibench/main.py

+20-19
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,13 @@ def get_parser() -> ArgumentParser: # pragma: no cover
2626
parser_record = sub_parsers.add_parser(
2727
"record", help="record data from running the test benches"
2828
)
29+
parser_interactive = sub_parsers.add_parser(
30+
"interactive", help="show the interactive TUI"
31+
)
32+
sub_parsers.add_parser(
33+
"report", help="report analysis about completed test bench runs"
34+
)
35+
2936
parser_record.add_argument(
3037
"-d",
3138
"--dry-run",
@@ -38,21 +45,13 @@ def get_parser() -> ArgumentParser: # pragma: no cover
3845
action="store_true",
3946
help="wait for the submitted jobs to finish to exit",
4047
)
41-
parser_record.add_argument(
42-
"-nc",
43-
"--no-clobber",
44-
action="store_true",
45-
help="don't delete any previous run results of the test benches",
46-
)
47-
parser_report = sub_parsers.add_parser(
48-
"report", help="report analysis about completed test bench runs"
49-
)
50-
parser_report.add_argument(
51-
"-i",
52-
"--interactive",
53-
action="store_true",
54-
help="show the interactive TUI",
55-
)
48+
for sub_parser in (parser_record, parser_interactive):
49+
sub_parser.add_argument(
50+
"-nc",
51+
"--no-clobber",
52+
action="store_true",
53+
help="don't delete any previous run results of the test benches",
54+
)
5655
return parser
5756

5857

@@ -65,7 +64,9 @@ def main() -> None: # pragma: no cover
6564
test_plan.record_all(args)
6665

6766
elif args.command == "report":
68-
if args.interactive:
69-
UserInterface(test_plan, args).run()
70-
else:
71-
test_plan.report_all(args)
67+
test_plan.report_all(args)
68+
69+
else:
70+
args.dry_run = False
71+
args.wait = False
72+
UserInterface(test_plan, args).run()

src/hpc_multibench/tui/interactive_ui.py

-4
Original file line numberDiff line numberDiff line change
@@ -180,10 +180,6 @@ def __init__( # type: ignore[no-untyped-def]
180180
) -> None:
181181
"""Initialise the user interface."""
182182
self.test_plan: TestPlan = test_plan
183-
# TODO: Fix this in the main function
184-
command_args.dry_run = False
185-
command_args.wait = False
186-
command_args.no_clobber = False
187183
self.command_args: Namespace = command_args
188184
self.show_mode = ShowMode.Uninitialised
189185
self.current_test_bench: TestBench | None = None

0 commit comments

Comments
 (0)