diff options
Diffstat (limited to 'example/usage.zig')
| -rw-r--r-- | example/usage.zig | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/example/usage.zig b/example/usage.zig index 20d4736..f57b07c 100644 --- a/example/usage.zig +++ b/example/usage.zig | |||
| @@ -2,11 +2,12 @@ const clap = @import("clap"); | |||
| 2 | const std = @import("std"); | 2 | 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.parseParamsComptime( |
| 6 | clap.parseParam("-h, --help Display this help and exit.") catch unreachable, | 6 | \\-h, --help Display this help and exit. |
| 7 | clap.parseParam("-v, --version Output version information and exit.") catch unreachable, | 7 | \\-v, --version Output version information and exit. |
| 8 | clap.parseParam(" --value <str> An option parameter, which takes a value.") catch unreachable, | 8 | \\ --value <str> An option parameter, which takes a value. |
| 9 | }; | 9 | \\ |
| 10 | ); | ||
| 10 | 11 | ||
| 11 | var res = try clap.parse(clap.Help, ¶ms, clap.parsers.default, .{}); | 12 | var res = try clap.parse(clap.Help, ¶ms, clap.parsers.default, .{}); |
| 12 | defer res.deinit(); | 13 | defer res.deinit(); |