diff options
Diffstat (limited to 'src/cmd/pipe.zig')
-rw-r--r-- | src/cmd/pipe.zig | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/cmd/pipe.zig b/src/cmd/pipe.zig index 4f079cb..f97561a 100644 --- a/src/cmd/pipe.zig +++ b/src/cmd/pipe.zig @@ -4,6 +4,7 @@ const print = std.debug.print; const types = @import("./lib/types.zig"); const CommandStatus = types.CommandStatus; +const CommandContext = types.CommandContext; const OutputCapture = types.OutputCapture; const InputSource = types.InputSource; @@ -17,8 +18,11 @@ pub const PipeCommand = struct { left: *Command, right: *Command, - pub fn eval(pipe: PipeCommand, allocator: Allocator, output_capture: ?*OutputCapture, input_source: ?*InputSource, executeCommandWithOutput: ExecuteCommandFn) !CommandStatus { - _ = input_source; // Pipe handles its own input flow + pub fn eval(pipe: PipeCommand, ctx: CommandContext) !CommandStatus { + // Cast the execute function back to its proper type + const executeCommandWithOutput: ExecuteCommandFn = @ptrCast(@alignCast(ctx.execute_command.?)); + const allocator = ctx.allocator; + const output_capture = ctx.output_capture; // Create output capture for the left command var left_output = OutputCapture.init(allocator); |