home · contact · privacy
For command line invocation, fail on any undefined arguments.
authorChristian Heller <c.heller@plomlompom.de>
Thu, 2 Oct 2025 18:33:07 +0000 (20:33 +0200)
committerChristian Heller <c.heller@plomlompom.de>
Thu, 2 Oct 2025 18:33:07 +0000 (20:33 +0200)
src/run.py

index 053240c3b880cfffac1e16c17f42b257aabda4fe..94e3bdfd0bb8fe8bc28790ba99a9b706038f82fc 100755 (executable)
@@ -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)