diff options
Diffstat (limited to 'src/shell.zig')
| -rw-r--r-- | src/shell.zig | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/shell.zig b/src/shell.zig index 271e3ea..6f8bfef 100644 --- a/src/shell.zig +++ b/src/shell.zig @@ -19,9 +19,15 @@ pub fn executeCommand( error_redirect: ?[]const u8, append_output: ?[]const u8, append_error: ?[]const u8, + history_list: []const []const u8, ) !builtins.CommandResult { if (std.mem.eql(u8, cmd_name, "exit")) return builtins.executeExit(); + if (std.mem.eql(u8, cmd_name, "history")) { + try builtins.executeHistory(stdout, history_list); + return .continue_loop; + } + if (std.mem.eql(u8, cmd_name, "echo")) { if (error_redirect) |file| { const fd = try std.fs.cwd().createFile(file, .{}); |