diff options
Diffstat (limited to 'src/cmd/remove.zig')
-rw-r--r-- | src/cmd/remove.zig | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/src/cmd/remove.zig b/src/cmd/remove.zig index ba59504..8cf52b3 100644 --- a/src/cmd/remove.zig +++ b/src/cmd/remove.zig @@ -1,6 +1,5 @@ const std = @import("std"); const Allocator = std.mem.Allocator; -const print = std.debug.print; const types = @import("./lib/types.zig"); const CommandStatus = types.CommandStatus; @@ -16,11 +15,8 @@ pub const Remove = struct { if (std.mem.indexOf(u8, file_path, "*") != null or std.mem.indexOf(u8, file_path, "?") != null) { // Simple wildcard deletion - just show error for now const error_msg = "Wildcard deletion not yet implemented\n"; - if (ctx.output_capture) |capture| { - try capture.write(error_msg); - } else { - print("{s}", .{error_msg}); - } + var writer = ctx.output_writer; + try writer.write(error_msg); return CommandStatus{ .Code = 1 }; } @@ -32,11 +28,8 @@ pub const Remove = struct { error.IsDir => "Access denied - cannot delete directory\n", else => "Cannot delete file\n", }; - if (ctx.output_capture) |capture| { - try capture.write(error_msg); - } else { - print("{s}", .{error_msg}); - } + var writer = ctx.output_writer; + try writer.write(error_msg); return CommandStatus{ .Code = 1 }; }; |