diff options
Diffstat (limited to '')
| -rw-r--r-- | example/usage.zig | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/example/usage.zig b/example/usage.zig index 368a6b3..04fedba 100644 --- a/example/usage.zig +++ b/example/usage.zig | |||
| @@ -3,17 +3,17 @@ const std = @import("std"); | |||
| 3 | 3 | ||
| 4 | pub fn main() !void { | 4 | pub fn main() !void { |
| 5 | const params = comptime [_]clap.Param(clap.Help){ | 5 | const params = comptime [_]clap.Param(clap.Help){ |
| 6 | clap.parseParam("-h, --help Display this help and exit. ") catch unreachable, | 6 | clap.untyped.parseParam("-h, --help Display this help and exit.") catch unreachable, |
| 7 | clap.parseParam("-v, --version Output version information and exit. ") catch unreachable, | 7 | clap.untyped.parseParam("-v, --version Output version information and exit.") catch unreachable, |
| 8 | clap.parseParam(" --value <N> An option parameter, which takes a value.") catch unreachable, | 8 | clap.untyped.parseParam(" --value <N> An option parameter, which takes a value.") catch unreachable, |
| 9 | }; | 9 | }; |
| 10 | 10 | ||
| 11 | var args = try clap.parse(clap.Help, ¶ms, .{}); | 11 | var res = try clap.untyped.parse(clap.Help, ¶ms, .{}); |
| 12 | defer args.deinit(); | 12 | defer res.deinit(); |
| 13 | 13 | ||
| 14 | // clap.usage is a function that can print a simple usage message, given a | 14 | // clap.usage is a function that can print a simple usage message, given a |
| 15 | // slice of Param(Help). There is also a usageEx, which can print a | 15 | // slice of Param(Help). There is also a usageEx, which can print a |
| 16 | // usage message for any Param, but it is more verbose to call. | 16 | // usage message for any Param, but it is more verbose to call. |
| 17 | if (args.flag("--help")) | 17 | if (res.args.help) |
| 18 | return clap.usage(std.io.getStdErr().writer(), ¶ms); | 18 | return clap.usage(std.io.getStdErr().writer(), ¶ms); |
| 19 | } | 19 | } |