summaryrefslogtreecommitdiff
path: root/example/simple.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/simple.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 '')
-rw-r--r--example/simple.zig4
1 files changed, 2 insertions, 2 deletions
diff --git a/example/simple.zig b/example/simple.zig
index 74157a6..2b7bf0a 100644
--- a/example/simple.zig
+++ b/example/simple.zig
@@ -3,7 +3,7 @@ pub fn main() !void {
3 defer _ = gpa.deinit(); 3 defer _ = gpa.deinit();
4 4
5 // First we specify what parameters our program can take. 5 // First we specify what parameters our program can take.
6 // We can use `parseParamsComptime` to parse a string into an array of `Param(Help)` 6 // We can use `parseParamsComptime` to parse a string into an array of `Param(Help)`.
7 const params = comptime clap.parseParamsComptime( 7 const params = comptime clap.parseParamsComptime(
8 \\-h, --help Display this help and exit. 8 \\-h, --help Display this help and exit.
9 \\-n, --number <usize> An option parameter, which takes a value. 9 \\-n, --number <usize> An option parameter, which takes a value.
@@ -20,7 +20,7 @@ pub fn main() !void {
20 .diagnostic = &diag, 20 .diagnostic = &diag,
21 .allocator = gpa.allocator(), 21 .allocator = gpa.allocator(),
22 }) catch |err| { 22 }) catch |err| {
23 // Report useful error and exit 23 // Report useful error and exit.
24 diag.report(std.io.getStdErr().writer(), err) catch {}; 24 diag.report(std.io.getStdErr().writer(), err) catch {};
25 return err; 25 return err;
26 }; 26 };