diff options
| author | 2025-07-20 21:40:56 +0200 | |
|---|---|---|
| committer | 2025-07-21 18:52:54 +0200 | |
| commit | 6f103922a8133ba11773e6ad9a52e26e1d99b3e7 (patch) | |
| tree | 66bc5fa5fc36f20575be1e1a59ff890ab9c8b23e /example/help.zig | |
| parent | chore: Update setup-zig to v2 (diff) | |
| download | zig-clap-6f103922a8133ba11773e6ad9a52e26e1d99b3e7.tar.gz zig-clap-6f103922a8133ba11773e6ad9a52e26e1d99b3e7.tar.xz zig-clap-6f103922a8133ba11773e6ad9a52e26e1d99b3e7.zip | |
Update to Zig 0.15.0-dev.1147
Diffstat (limited to 'example/help.zig')
| -rw-r--r-- | example/help.zig | 8 |
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, ¶ms, .{}); | 21 | var buf: [1024]u8 = undefined; |
| 22 | var stderr = std.fs.File.stderr().writer(&buf); | ||
| 23 | try clap.help(&stderr.interface, clap.Help, ¶ms, .{}); | ||
| 24 | return stderr.interface.flush(); | ||
| 25 | } | ||
| 22 | } | 26 | } |
| 23 | 27 | ||
| 24 | const clap = @import("clap"); | 28 | const clap = @import("clap"); |