summaryrefslogtreecommitdiff
path: root/example/help.zig
diff options
context:
space:
mode:
Diffstat (limited to 'example/help.zig')
-rw-r--r--example/help.zig4
1 files changed, 3 insertions, 1 deletions
diff --git a/example/help.zig b/example/help.zig
index d8e8f12..a4379de 100644
--- a/example/help.zig
+++ b/example/help.zig
@@ -13,12 +13,14 @@ pub fn main() !void {
13 }); 13 });
14 defer res.deinit(); 14 defer res.deinit();
15 15
16 var threaded: std.Io.Threaded = .init_single_threaded;
17 const io: std.Io = threaded.io();
16 // `clap.help` is a function that can print a simple help message. It can print any `Param` 18 // `clap.help` is a function that can print a simple help message. It can print any `Param`
17 // where `Id` has a `description` and `value` method (`Param(Help)` is one such parameter). 19 // 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 20 // The last argument contains options as to how `help` should print those parameters. Using
19 // `.{}` means the default options. 21 // `.{}` means the default options.
20 if (res.args.help != 0) 22 if (res.args.help != 0)
21 return clap.helpToFile(.stderr(), clap.Help, &params, .{}); 23 return clap.helpToFile(io, .stderr(), clap.Help, &params, .{});
22} 24}
23 25
24const clap = @import("clap"); 26const clap = @import("clap");