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/help.zig | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'src/cmd/help.zig') diff --git a/src/cmd/help.zig b/src/cmd/help.zig index 4c91464..0a19e98 100644 --- a/src/cmd/help.zig +++ b/src/cmd/help.zig @@ -48,11 +48,8 @@ fn showGeneralHelp(ctx: CommandContext) !CommandStatus { \\ ; - if (ctx.output_capture) |output| { - try output.write(help_text); - } else { - try std.io.getStdOut().writeAll(help_text); - } + var writer = ctx.output_writer; + try writer.write(help_text); return CommandStatus{ .Code = 0 }; } @@ -63,11 +60,8 @@ fn showCommandHelp(command: []const u8, ctx: CommandContext) !CommandStatus { const help_text = getCommandSpecificHelp(cmd_upper); - if (ctx.output_capture) |output| { - try output.write(help_text); - } else { - try std.io.getStdOut().writeAll(help_text); - } + var writer = ctx.output_writer; + try writer.write(help_text); return CommandStatus{ .Code = 0 }; } -- cgit v1.2.1