diff options
| author | 2025-07-20 21:40:56 +0200 | |
|---|---|---|
| committer | 2025-07-21 18:52:54 +0200 | |
| commit | 6f103922a8133ba11773e6ad9a52e26e1d99b3e7 (patch) | |
| tree | 66bc5fa5fc36f20575be1e1a59ff890ab9c8b23e /example/streaming-clap.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/streaming-clap.zig')
| -rw-r--r-- | example/streaming-clap.zig | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/example/streaming-clap.zig b/example/streaming-clap.zig index 054c401..d60167c 100644 --- a/example/streaming-clap.zig +++ b/example/streaming-clap.zig | |||
| @@ -34,8 +34,10 @@ pub fn main() !void { | |||
| 34 | // Because we use a streaming parser, we have to consume each argument parsed individually. | 34 | // Because we use a streaming parser, we have to consume each argument parsed individually. |
| 35 | while (parser.next() catch |err| { | 35 | while (parser.next() catch |err| { |
| 36 | // Report useful error and exit. | 36 | // Report useful error and exit. |
| 37 | diag.report(std.io.getStdErr().writer(), err) catch {}; | 37 | var buf: [1024]u8 = undefined; |
| 38 | return err; | 38 | var stderr = std.fs.File.stderr().writer(&buf); |
| 39 | try diag.report(&stderr.interface, err); | ||
| 40 | return stderr.interface.flush(); | ||
| 39 | }) |arg| { | 41 | }) |arg| { |
| 40 | // arg.param will point to the parameter which matched the argument. | 42 | // arg.param will point to the parameter which matched the argument. |
| 41 | switch (arg.param.id) { | 43 | switch (arg.param.id) { |