~sircmpwn/hiprompt-gtk-py

dd9b7c9a8a01363a46001a01dd1aceb97b7b5f37 — Martijn Braam 2 years ago 3524ebf
Add error reporting for unknown commands
1 files changed, 3 insertions(+), 0 deletions(-)

M hiprompt_gtk/proto.py
M hiprompt_gtk/proto.py => hiprompt_gtk/proto.py +3 -0
@@ 19,6 19,9 @@ class Session:
            parts = line.strip().partition(" ")
            cmd = parts[0]
            args = parts[2]
            if not hasattr(self, "_" + cmd):
                sys.stderr.write(f"Unknown command '{cmd}'\n")
                exit(127)
            more = getattr(self, "_" + cmd)(args)
            if more is False:
                break