summaryrefslogtreecommitdiff
path: root/src/cmd/pipe.zig
diff options
context:
space:
mode:
authorMatthias Andreas Benkard <code@mail.matthias.benkard.de>2025-08-16 12:50:23 +0200
committerMatthias Andreas Benkard <code@mail.matthias.benkard.de>2025-08-16 12:50:23 +0200
commit9edc1338b92d1ead4c5f2fad8c0516037963f7b6 (patch)
tree64f3ed617771f9327bd49e3732adb9271e3559cc /src/cmd/pipe.zig
parent754a74da6052c9f5e8dc4a536c58ccc11cb66369 (diff)
Unify output handling.
Now every command always uses an OutputWriter instead of conditionally writing directly to stdout using std.debug.print.
Diffstat (limited to 'src/cmd/pipe.zig')
-rw-r--r--src/cmd/pipe.zig6
1 files changed, 5 insertions, 1 deletions
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);