ikskuh/zig-args

Add support for counting options

Opened this issue · 0 comments

Some options like --verbose or -v can often be specified multiple times. This behaviour can be implemented by a predefined type from args:

var cli = parse(struct {
    verbose: args.Counter = .{}, // starts at 0
}, …);
std.debug.print("{}\n", .{cli.options.verbose.count });