diff options
| author | 2024-07-18 16:56:11 +0200 | |
|---|---|---|
| committer | 2024-07-18 17:15:37 +0200 | |
| commit | f0a281ffe91fb64f116dcb04c34cecef70e8c79c (patch) | |
| tree | 3768dd0d4f18871161646493bc18260e1f2786a4 /example | |
| parent | Update to newest version of zig (diff) | |
| download | zig-clap-f0a281ffe91fb64f116dcb04c34cecef70e8c79c.tar.gz zig-clap-f0a281ffe91fb64f116dcb04c34cecef70e8c79c.tar.xz zig-clap-f0a281ffe91fb64f116dcb04c34cecef70e8c79c.zip | |
feat: Allow for the assignment separator to be configured
Diffstat (limited to 'example')
| -rw-r--r-- | example/simple-ex.zig | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/example/simple-ex.zig b/example/simple-ex.zig index 436d058..2943f4e 100644 --- a/example/simple-ex.zig +++ b/example/simple-ex.zig | |||
| @@ -34,6 +34,9 @@ pub fn main() !void { | |||
| 34 | var res = clap.parse(clap.Help, ¶ms, parsers, .{ | 34 | var res = clap.parse(clap.Help, ¶ms, parsers, .{ |
| 35 | .diagnostic = &diag, | 35 | .diagnostic = &diag, |
| 36 | .allocator = gpa.allocator(), | 36 | .allocator = gpa.allocator(), |
| 37 | // The assignment separator can be configured. `--number=1` and `--number:1` is now | ||
| 38 | // allowed. | ||
| 39 | .assignment_separators = "=:", | ||
| 37 | }) catch |err| { | 40 | }) catch |err| { |
| 38 | diag.report(io.getStdErr().writer(), err) catch {}; | 41 | diag.report(io.getStdErr().writer(), err) catch {}; |
| 39 | return err; | 42 | return err; |