diff options
Diffstat (limited to 'src/cmd/rmdir.zig')
-rw-r--r-- | src/cmd/rmdir.zig | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/cmd/rmdir.zig b/src/cmd/rmdir.zig index cbb0b92..db41fab 100644 --- a/src/cmd/rmdir.zig +++ b/src/cmd/rmdir.zig @@ -4,15 +4,14 @@ const print = std.debug.print; const types = @import("./lib/types.zig"); const CommandStatus = types.CommandStatus; -const OutputCapture = types.OutputCapture; -const InputSource = types.InputSource; +const CommandContext = types.CommandContext; pub const Rmdir = struct { path: []const u8, - pub fn eval(rmdir: Rmdir, allocator: Allocator, output_capture: ?*OutputCapture, input_source: ?*InputSource) !CommandStatus { - _ = allocator; - _ = input_source; + pub fn eval(rmdir: Rmdir, ctx: CommandContext) !CommandStatus { + _ = ctx.allocator; + _ = ctx.input_source; const dir_path = rmdir.path; @@ -25,7 +24,7 @@ pub const Rmdir = struct { error.NotDir => "The system cannot find the path specified\n", else => "Unable to remove directory\n", }; - if (output_capture) |capture| { + if (ctx.output_capture) |capture| { try capture.write(error_msg); } else { print("{s}", .{error_msg}); |