summaryrefslogtreecommitdiff
path: root/src/cmd/help.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/help.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/help.zig')
-rw-r--r--src/cmd/help.zig14
1 files changed, 4 insertions, 10 deletions
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 };
}