diff options
Diffstat (limited to 'example/usage.zig')
| -rw-r--r-- | example/usage.zig | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/example/usage.zig b/example/usage.zig index aab9cb6..c1440b9 100644 --- a/example/usage.zig +++ b/example/usage.zig | |||
| @@ -14,10 +14,13 @@ pub fn main() !void { | |||
| 14 | }); | 14 | }); |
| 15 | defer res.deinit(); | 15 | defer res.deinit(); |
| 16 | 16 | ||
| 17 | var threaded: std.Io.Threaded = .init_single_threaded; | ||
| 18 | const io: std.Io = threaded.io(); | ||
| 19 | |||
| 17 | // `clap.usageToFile` is a function that can print a simple usage string. It can print any | 20 | // `clap.usageToFile` is a function that can print a simple usage string. It can print any |
| 18 | // `Param` where `Id` has a `value` method (`Param(Help)` is one such parameter). | 21 | // `Param` where `Id` has a `value` method (`Param(Help)` is one such parameter). |
| 19 | if (res.args.help != 0) | 22 | if (res.args.help != 0) |
| 20 | return clap.usageToFile(.stdout(), clap.Help, ¶ms); | 23 | return clap.usageToFile(io, .stdout(), clap.Help, ¶ms); |
| 21 | } | 24 | } |
| 22 | 25 | ||
| 23 | const clap = @import("clap"); | 26 | const clap = @import("clap"); |