From 4dd206a5a3a32e23e05c0842ce4db7a108de4d5f Mon Sep 17 00:00:00 2001 From: Matthias Andreas Benkard Date: Thu, 14 Aug 2025 17:50:42 +0200 Subject: Refactor shared eval function parameters into a CommandContext struct. --- src/cmd/cls.zig | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'src/cmd/cls.zig') diff --git a/src/cmd/cls.zig b/src/cmd/cls.zig index 70c1fc4..4e7b8c6 100644 --- a/src/cmd/cls.zig +++ b/src/cmd/cls.zig @@ -4,16 +4,13 @@ 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 Cls = struct { - pub fn eval(cls: Cls, allocator: Allocator, output_capture: ?*OutputCapture, input_source: ?*InputSource) !CommandStatus { + pub fn eval(cls: Cls, ctx: CommandContext) !CommandStatus { _ = cls; - _ = allocator; - _ = input_source; - if (output_capture == null) { + if (ctx.output_capture == null) { // Clear screen - only works when not redirected print("\x1B[2J\x1B[H", .{}); } -- cgit v1.2.1