From 5f7b75d5523d9581eca5a72a362868ff517992e8 Mon Sep 17 00:00:00 2001 From: Jimmi Holst Christensen Date: Fri, 25 Feb 2022 19:40:00 +0100 Subject: 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. --- example/simple-error.zig | 13 ------------- 1 file changed, 13 deletions(-) delete mode 100644 example/simple-error.zig (limited to 'example/simple-error.zig') 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 @@ -const clap = @import("clap"); -const std = @import("std"); - -pub fn main() !void { - const params = comptime [_]clap.Param(clap.Help){ - clap.parseParam("-h, --help Display this help and exit.") catch unreachable, - }; - - var args = try clap.parse(clap.Help, ¶ms, .{}); - defer args.deinit(); - - _ = args.flag("--helps"); -} -- cgit v1.2.3