PlanOpticon

fix(companion): quit/exit/bye/q work without slash prefix

lmata 2026-03-07 23:45 trunk
Commit 8f6769ccd696ffaa56eefa6dbab3f0b5e0ce9d9f4f36bfac6205e34634bb6d5b
--- tests/test_companion.py
+++ tests/test_companion.py
@@ -78,10 +78,26 @@
7878
7979
def test_exit(self):
8080
repl = CompanionREPL()
8181
assert repl.handle_input("/exit") == "__QUIT__"
8282
83
+ def test_bare_quit(self):
84
+ repl = CompanionREPL()
85
+ assert repl.handle_input("quit") == "__QUIT__"
86
+
87
+ def test_bare_exit(self):
88
+ repl = CompanionREPL()
89
+ assert repl.handle_input("exit") == "__QUIT__"
90
+
91
+ def test_bare_bye(self):
92
+ repl = CompanionREPL()
93
+ assert repl.handle_input("bye") == "__QUIT__"
94
+
95
+ def test_bare_q(self):
96
+ repl = CompanionREPL()
97
+ assert repl.handle_input("q") == "__QUIT__"
98
+
8399
84100
class TestHandleUnknownSlash:
85101
def test_unknown_command(self):
86102
repl = CompanionREPL()
87103
output = repl.handle_input("/foobar")
88104
--- tests/test_companion.py
+++ tests/test_companion.py
@@ -78,10 +78,26 @@
78
79 def test_exit(self):
80 repl = CompanionREPL()
81 assert repl.handle_input("/exit") == "__QUIT__"
82
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
83
84 class TestHandleUnknownSlash:
85 def test_unknown_command(self):
86 repl = CompanionREPL()
87 output = repl.handle_input("/foobar")
88
--- tests/test_companion.py
+++ tests/test_companion.py
@@ -78,10 +78,26 @@
78
79 def test_exit(self):
80 repl = CompanionREPL()
81 assert repl.handle_input("/exit") == "__QUIT__"
82
83 def test_bare_quit(self):
84 repl = CompanionREPL()
85 assert repl.handle_input("quit") == "__QUIT__"
86
87 def test_bare_exit(self):
88 repl = CompanionREPL()
89 assert repl.handle_input("exit") == "__QUIT__"
90
91 def test_bare_bye(self):
92 repl = CompanionREPL()
93 assert repl.handle_input("bye") == "__QUIT__"
94
95 def test_bare_q(self):
96 repl = CompanionREPL()
97 assert repl.handle_input("q") == "__QUIT__"
98
99
100 class TestHandleUnknownSlash:
101 def test_unknown_command(self):
102 repl = CompanionREPL()
103 output = repl.handle_input("/foobar")
104
--- video_processor/cli/companion.py
+++ video_processor/cli/companion.py
@@ -394,10 +394,14 @@
394394
def handle_input(self, line: str) -> str:
395395
"""Process a single input line and return output."""
396396
line = line.strip()
397397
if not line:
398398
return ""
399
+
400
+ # Bare quit/exit/bye without slash
401
+ if line.lower() in ("quit", "exit", "bye", "q"):
402
+ return "__QUIT__"
399403
400404
if not line.startswith("/"):
401405
return self._cmd_chat(line)
402406
403407
parts = line.split(maxsplit=1)
404408
--- video_processor/cli/companion.py
+++ video_processor/cli/companion.py
@@ -394,10 +394,14 @@
394 def handle_input(self, line: str) -> str:
395 """Process a single input line and return output."""
396 line = line.strip()
397 if not line:
398 return ""
 
 
 
 
399
400 if not line.startswith("/"):
401 return self._cmd_chat(line)
402
403 parts = line.split(maxsplit=1)
404
--- video_processor/cli/companion.py
+++ video_processor/cli/companion.py
@@ -394,10 +394,14 @@
394 def handle_input(self, line: str) -> str:
395 """Process a single input line and return output."""
396 line = line.strip()
397 if not line:
398 return ""
399
400 # Bare quit/exit/bye without slash
401 if line.lower() in ("quit", "exit", "bye", "q"):
402 return "__QUIT__"
403
404 if not line.startswith("/"):
405 return self._cmd_chat(line)
406
407 parts = line.split(maxsplit=1)
408

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button