diff options
| author | 2019-12-09 20:03:39 -0800 | |
|---|---|---|
| committer | 2019-12-09 20:09:16 -0800 | |
| commit | c5f6c0861d5a9d69783ec8838b97eedc38932b34 (patch) | |
| tree | 312476823228ea69da8773817185cccec78acfaa /example/streaming-clap.zig | |
| parent | Merge pull request #12 from dbandstra/update-for-latest-zig (diff) | |
| download | zig-clap-c5f6c0861d5a9d69783ec8838b97eedc38932b34.tar.gz zig-clap-c5f6c0861d5a9d69783ec8838b97eedc38932b34.tar.xz zig-clap-c5f6c0861d5a9d69783ec8838b97eedc38932b34.zip | |
update for latest zig (varargs is no more)
Diffstat (limited to '')
| -rw-r--r-- | example/streaming-clap.zig | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/example/streaming-clap.zig b/example/streaming-clap.zig index c9f20e2..b277266 100644 --- a/example/streaming-clap.zig +++ b/example/streaming-clap.zig | |||
| @@ -38,13 +38,13 @@ pub fn main() !void { | |||
| 38 | while (try parser.next()) |arg| { | 38 | while (try parser.next()) |arg| { |
| 39 | // arg.param will point to the parameter which matched the argument. | 39 | // arg.param will point to the parameter which matched the argument. |
| 40 | switch (arg.param.id) { | 40 | switch (arg.param.id) { |
| 41 | 'h' => debug.warn("Help!\n"), | 41 | 'h' => debug.warn("Help!\n", .{}), |
| 42 | 'n' => debug.warn("--number = {}\n", arg.value.?), | 42 | 'n' => debug.warn("--number = {}\n", .{ arg.value.? }), |
| 43 | 43 | ||
| 44 | // arg.value == null, if arg.param.takes_value == false. | 44 | // arg.value == null, if arg.param.takes_value == false. |
| 45 | // Otherwise, arg.value is the value passed with the argument, such as "-a=10" | 45 | // Otherwise, arg.value is the value passed with the argument, such as "-a=10" |
| 46 | // or "-a 10". | 46 | // or "-a 10". |
| 47 | 'f' => debug.warn("{}\n", arg.value.?), | 47 | 'f' => debug.warn("{}\n", .{ arg.value.? }), |
| 48 | else => unreachable, | 48 | else => unreachable, |
| 49 | } | 49 | } |
| 50 | } | 50 | } |