summaryrefslogtreecommitdiff
path: root/example/streaming-clap.zig
diff options
context:
space:
mode:
authorGravatar JustAnotherCodemonkey2024-11-25 07:57:42 +0000
committerGravatar GitHub2024-11-25 08:57:42 +0100
commit560c8dd72ab25d556123846254040c5bf9ad3ba4 (patch)
treea5c57b24b67fdc1fc71abf444d422062453921be /example/streaming-clap.zig
parentrefactor: switch on signedness (diff)
downloadzig-clap-560c8dd72ab25d556123846254040c5bf9ad3ba4.tar.gz
zig-clap-560c8dd72ab25d556123846254040c5bf9ad3ba4.tar.xz
zig-clap-560c8dd72ab25d556123846254040c5bf9ad3ba4.zip
Patch up README and fix comments in example files. (#143)
The readme was also reflowed to 100 cols. I probably should have put that in a separate commit but oh well. The comments were not subjected to reflowing (yet).
Diffstat (limited to 'example/streaming-clap.zig')
-rw-r--r--example/streaming-clap.zig4
1 files changed, 2 insertions, 2 deletions
diff --git a/example/streaming-clap.zig b/example/streaming-clap.zig
index 2a20bcb..054c401 100644
--- a/example/streaming-clap.zig
+++ b/example/streaming-clap.zig
@@ -18,7 +18,7 @@ pub fn main() !void {
18 var iter = try std.process.ArgIterator.initWithAllocator(allocator); 18 var iter = try std.process.ArgIterator.initWithAllocator(allocator);
19 defer iter.deinit(); 19 defer iter.deinit();
20 20
21 // Skip exe argument 21 // Skip exe argument.
22 _ = iter.next(); 22 _ = iter.next();
23 23
24 // Initialize our diagnostics, which can be used for reporting useful errors. 24 // Initialize our diagnostics, which can be used for reporting useful errors.
@@ -33,7 +33,7 @@ pub fn main() !void {
33 33
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 diag.report(std.io.getStdErr().writer(), err) catch {};
38 return err; 38 return err;
39 }) |arg| { 39 }) |arg| {