From f58e4507f913bf3a6f5afee14650f058ecf6be84 Mon Sep 17 00:00:00 2001 From: Lucas Faria Mendes Date: Fri, 5 Dec 2025 05:18:27 -0300 Subject: codecrafters submit [skip ci] --- src/shell.zig | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/shell.zig') 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, .{}); -- cgit v1.2.3