diff options
| author | 2026-01-02 20:59:20 +0900 | |
|---|---|---|
| committer | 2026-01-02 20:59:20 +0900 | |
| commit | 3c35ff18bb32fec2f53e12e6bdbb00422d6c33fe (patch) | |
| tree | 71b3c0023650979eceee27bc37f507d2e73a7e17 /example/usage.zig | |
| parent | hotfix: replace deprecated std.fs.File with std.Io.File for Zig v0.16 (diff) | |
| download | zig-clap-3c35ff18bb32fec2f53e12e6bdbb00422d6c33fe.tar.gz zig-clap-3c35ff18bb32fec2f53e12e6bdbb00422d6c33fe.tar.xz zig-clap-3c35ff18bb32fec2f53e12e6bdbb00422d6c33fe.zip | |
chore: update examples to use std.Io for Zig v0.16 compatibility
Signed-off-by: Takumi Katase <takumi.katase@devoc.ninja>
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"); |