From 9edc1338b92d1ead4c5f2fad8c0516037963f7b6 Mon Sep 17 00:00:00 2001 From: Matthias Andreas Benkard Date: Sat, 16 Aug 2025 12:50:23 +0200 Subject: Unify output handling. Now every command always uses an OutputWriter instead of conditionally writing directly to stdout using std.debug.print. --- src/cmd/pipe.zig | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/cmd/pipe.zig') diff --git a/src/cmd/pipe.zig b/src/cmd/pipe.zig index 39bee8c..c3d08e4 100644 --- a/src/cmd/pipe.zig +++ b/src/cmd/pipe.zig @@ -18,7 +18,11 @@ pub const PipeCommand = struct { pub fn eval(pipe: PipeCommand, ctx: CommandContext) !CommandStatus { const execute_command = ctx.execute_command; const allocator = ctx.allocator; - const output_capture = ctx.output_capture; + // Extract output_capture from the output_writer for pipe logic + const output_capture = switch (ctx.output_writer) { + .capture => |capture| capture, + .stdout => null, + }; // Create output capture for the left command var left_output = OutputCapture.init(allocator); -- cgit v1.2.1