summaryrefslogtreecommitdiff
path: root/example/streaming-clap.zig
diff options
context:
space:
mode:
Diffstat (limited to 'example/streaming-clap.zig')
-rw-r--r--example/streaming-clap.zig6
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) {