diff options
| author | 2023-04-02 06:10:40 -0500 | |
|---|---|---|
| committer | 2023-04-02 13:10:40 +0200 | |
| commit | ab69ef2db44b6c4b7f00283d52d38fbe71d16c42 (patch) | |
| tree | 10416c0cdda32ba98d54954940c440beac6ccf08 /example/help.zig | |
| parent | Update build script to actually run the tests (diff) | |
| download | zig-clap-ab69ef2db44b6c4b7f00283d52d38fbe71d16c42.tar.gz zig-clap-ab69ef2db44b6c4b7f00283d52d38fbe71d16c42.tar.xz zig-clap-ab69ef2db44b6c4b7f00283d52d38fbe71d16c42.zip | |
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)
Diffstat (limited to 'example/help.zig')
| -rw-r--r-- | example/help.zig | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/example/help.zig b/example/help.zig index dd9c9ea..e83ae44 100644 --- a/example/help.zig +++ b/example/help.zig | |||
| @@ -15,6 +15,6 @@ pub fn main() !void { | |||
| 15 | // where `Id` has a `describtion` and `value` method (`Param(Help)` is one such parameter). | 15 | // where `Id` has a `describtion` and `value` method (`Param(Help)` is one such parameter). |
| 16 | // The last argument contains options as to how `help` should print those parameters. Using | 16 | // The last argument contains options as to how `help` should print those parameters. Using |
| 17 | // `.{}` means the default options. | 17 | // `.{}` means the default options. |
| 18 | if (res.args.help) | 18 | if (res.args.help != 0) |
| 19 | return clap.help(std.io.getStdErr().writer(), clap.Help, ¶ms, .{}); | 19 | return clap.help(std.io.getStdErr().writer(), clap.Help, ¶ms, .{}); |
| 20 | } | 20 | } |