diff options
| author | 2022-02-25 19:40:00 +0100 | |
|---|---|---|
| committer | 2022-03-09 18:12:40 +0100 | |
| commit | 5f7b75d5523d9581eca5a72a362868ff517992e8 (patch) | |
| tree | 5e874f9c935e0d7c838ea5aadf270ce2929f8e8a /example/simple-error.zig | |
| parent | Bump actions/checkout from 2.4.0 to 3 (diff) | |
| download | zig-clap-5f7b75d5523d9581eca5a72a362868ff517992e8.tar.gz zig-clap-5f7b75d5523d9581eca5a72a362868ff517992e8.tar.xz zig-clap-5f7b75d5523d9581eca5a72a362868ff517992e8.zip | |
Allow for clap to parse argument values into types
This changes
- `.flag`, `.option`, `.options` and `.positionals` are now just fields
you access on the result of `parse` and `parseEx`.
- `clap.ComptimeClap` has been removed.
- `clap.StreamingClap` is now called `clap.streaming.Clap`
- `parse` and `parseEx` now takes a `value_parsers` argument that
provides the parsers to parse values.
- Remove `helpEx`, `helpFull`, `usageEx` and `usageFull`. They now just
expect `Id` to have methods for getting the description and value
texts.
Diffstat (limited to 'example/simple-error.zig')
| -rw-r--r-- | example/simple-error.zig | 13 |
1 files changed, 0 insertions, 13 deletions
diff --git a/example/simple-error.zig b/example/simple-error.zig deleted file mode 100644 index c04a9c6..0000000 --- a/example/simple-error.zig +++ /dev/null | |||
| @@ -1,13 +0,0 @@ | |||
| 1 | const clap = @import("clap"); | ||
| 2 | const std = @import("std"); | ||
| 3 | |||
| 4 | pub fn main() !void { | ||
| 5 | const params = comptime [_]clap.Param(clap.Help){ | ||
| 6 | clap.parseParam("-h, --help Display this help and exit.") catch unreachable, | ||
| 7 | }; | ||
| 8 | |||
| 9 | var args = try clap.parse(clap.Help, ¶ms, .{}); | ||
| 10 | defer args.deinit(); | ||
| 11 | |||
| 12 | _ = args.flag("--helps"); | ||
| 13 | } | ||