From ab69ef2db44b6c4b7f00283d52d38fbe71d16c42 Mon Sep 17 00:00:00 2001 From: Devin J. Pohly Date: Sun, 2 Apr 2023 06:10:40 -0500 Subject: Count occurrences of flags (was "Add .count type for flags") (#96) Breaking change: parseEx now counts the number of occurrences of flag parameters (those with takes_value == .none) and returns the count as a u8. Users of the library will need to change if (arg_result.my_flag) to if (arg_result.my_flag != 0) --- example/simple.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'example/simple.zig') diff --git a/example/simple.zig b/example/simple.zig index 2d32463..429f095 100644 --- a/example/simple.zig +++ b/example/simple.zig @@ -28,7 +28,7 @@ pub fn main() !void { }; defer res.deinit(); - if (res.args.help) + if (res.args.help != 0) debug.print("--help\n", .{}); if (res.args.number) |n| debug.print("--number = {}\n", .{n}); -- cgit v1.2.3