diff options
Diffstat (limited to 'src/host/Console.zig')
| -rw-r--r-- | src/host/Console.zig | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/host/Console.zig b/src/host/Console.zig index d9aa469..e6be2f0 100644 --- a/src/host/Console.zig +++ b/src/host/Console.zig @@ -135,7 +135,7 @@ pub fn execute(self: *Console, host: *Host, line: []const u8, now: u64) ![]const if (eq(command, "help")) { self.log("save|load [1..7] snapshot N | record|play [0..15] recording N | stop | pause | step N | seek start|end|<ms>"); self.log("diff [N] | reset | get <field> | set <field> <value> | overlay memory|sound | quit"); - if (!host.forward(self, line, now)) self.log("Backtick hides the console. Tab completes."); + if (host.forward(self, line, now) == .unknown) self.log("Backtick hides the console. Tab completes."); return &.{}; } if (eq(command, "overlay")) { @@ -210,7 +210,11 @@ pub fn execute(self: *Console, host: *Host, line: []const u8, now: u64) ![]const } else { // Sketch commands edit state outside the recorded input. h.stop(now); - if (!host.forward(self, line, now)) return error.UnknownCommand; + switch (host.forward(self, line, now)) { + .unknown => return error.UnknownCommand, + .failed => return error.CommandFailed, + .done => {}, + } } return &.{}; } |
