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, 2 insertions, 4 deletions
diff --git a/example/streaming-clap.zig b/example/streaming-clap.zig
index d60167c..4cd6962 100644
--- a/example/streaming-clap.zig
+++ b/example/streaming-clap.zig
@@ -34,10 +34,8 @@ 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 var buf: [1024]u8 = undefined; 37 try diag.reportToFile(.stderr(), err);
38 var stderr = std.fs.File.stderr().writer(&buf); 38 return err;
39 try diag.report(&stderr.interface, err);
40 return stderr.interface.flush();
41 }) |arg| { 39 }) |arg| {
42 // arg.param will point to the parameter which matched the argument. 40 // arg.param will point to the parameter which matched the argument.
43 switch (arg.param.id) { 41 switch (arg.param.id) {