summaryrefslogtreecommitdiff
path: root/example/help.zig
diff options
context:
space:
mode:
Diffstat (limited to 'example/help.zig')
-rw-r--r--example/help.zig8
1 files changed, 6 insertions, 2 deletions
diff --git a/example/help.zig b/example/help.zig
index b80ee35..676a56a 100644
--- a/example/help.zig
+++ b/example/help.zig
@@ -17,8 +17,12 @@ pub fn main() !void {
17 // where `Id` has a `description` and `value` method (`Param(Help)` is one such parameter). 17 // where `Id` has a `description` and `value` method (`Param(Help)` is one such parameter).
18 // The last argument contains options as to how `help` should print those parameters. Using 18 // The last argument contains options as to how `help` should print those parameters. Using
19 // `.{}` means the default options. 19 // `.{}` means the default options.
20 if (res.args.help != 0) 20 if (res.args.help != 0) {
21 return clap.help(std.io.getStdErr().writer(), clap.Help, &params, .{}); 21 var buf: [1024]u8 = undefined;
22 var stderr = std.fs.File.stderr().writer(&buf);
23 try clap.help(&stderr.interface, clap.Help, &params, .{});
24 return stderr.interface.flush();
25 }
22} 26}
23 27
24const clap = @import("clap"); 28const clap = @import("clap");