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/usage.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'example/usage.zig') diff --git a/example/usage.zig b/example/usage.zig index 0d21352..333536b 100644 --- a/example/usage.zig +++ b/example/usage.zig @@ -14,6 +14,6 @@ pub fn main() !void { // `clap.usage` is a function that can print a simple help message. It can print any `Param` // where `Id` has a `value` method (`Param(Help)` is one such parameter). - if (res.args.help) + if (res.args.help != 0) return clap.usage(std.io.getStdErr().writer(), clap.Help, ¶ms); } -- cgit v1.2.3