Updating to support \n separated commands, might need to support \r\n

as well, but this'll do for now
This commit is contained in:
Rob Emery committed 2026-10-25 09:07:14 +00:00
1 parent 8bd9231432
commit 2ecef98263
1 file changed
+5 -2
+5 -2
View File
@@ -285,10 +285,13 @@ class Handler(SimpleHTTPRequestHandler):
))
return parts
def parse_cmd(self, cmd):
def parse_cmd(self, cmdstring):
response = ""
for cmd in cmdstring.split("\n"):
pieces = cmd.split(" ")
handler = self.get_parsers().get(pieces[0])
return handler(pieces) if handler else {}
response += str(handler(pieces)) + "\n"
return response
def get_parsers(self):
return {