From e283a16163f5eb1927fbc0a336b761ecc63f5489 Mon Sep 17 00:00:00 2001 From: Christian Heller Date: Thu, 2 Oct 2025 20:33:07 +0200 Subject: [PATCH] For command line invocation, fail on any undefined arguments. --- src/run.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/run.py b/src/run.py index 053240c..94e3bdf 100755 --- a/src/run.py +++ b/src/run.py @@ -3,7 +3,7 @@ # standard libs from queue import SimpleQueue -from sys import argv +from sys import argv, exit as sys_exit # non-standard libs from plomlib.setup import dependency_hint try: @@ -42,7 +42,9 @@ def main_loop(cls_term: type[TerminalInterface], cls_tui: type[BaseTui] if __name__ == '__main__': - if len(argv) > 1 and argv[1] == 'test': + if len(argv) == 0: + main_loop(Terminal, ClientTui) + elif len(argv) > 1 and argv[1] == 'test': for path in PATH_TESTS.iterdir(): if path.parts[-1].endswith('.toml'): continue @@ -50,4 +52,5 @@ if __name__ == '__main__': main_loop(TestTerminal, TestingClientTui.on_file(path)) print('(success!)') else: - main_loop(Terminal, ClientTui) + print(f'unrecognized argument(s): {argv[1:]}') + sys_exit(1) -- 2.30.2