diff options
| author | 2018-04-27 00:25:12 +0200 | |
|---|---|---|
| committer | 2018-04-27 00:25:12 +0200 | |
| commit | 25e7072686cfa3b91df689bf5b76c6fb728003f6 (patch) | |
| tree | 34684285a170012923726273ea3d5e970aa0d969 /example.zig | |
| parent | Added the ability to have argument have indexs (diff) | |
| download | zig-clap-25e7072686cfa3b91df689bf5b76c6fb728003f6.tar.gz zig-clap-25e7072686cfa3b91df689bf5b76c6fb728003f6.tar.xz zig-clap-25e7072686cfa3b91df689bf5b76c6fb728003f6.zip | |
Short args can now take values directly after the arg
* closes #5
Diffstat (limited to '')
| -rw-r--r-- | example.zig | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/example.zig b/example.zig index c77ef5c..4d63b02 100644 --- a/example.zig +++ b/example.zig | |||
| @@ -22,12 +22,17 @@ const Options = struct { | |||
| 22 | // a = 1 | 22 | // a = 1 |
| 23 | // zig-clap> .\example.exe -pa 1 | 23 | // zig-clap> .\example.exe -pa 1 |
| 24 | // a = 1 | 24 | // a = 1 |
| 25 | // zig-clap> .\example.exe -pd friend | 25 | // zig-clap> .\example.exe -pd V1 |
| 26 | // d = friend | 26 | // d = V1 |
| 27 | // zig-clap> .\example.exe -pd=friend | 27 | // zig-clap> .\example.exe -pd=V2 |
| 28 | // d = friend | 28 | // d = V2 |
| 29 | // zig-clap> .\example.exe -p -d=friend | 29 | // zig-clap> .\example.exe -p -d=V3 |
| 30 | // d = friend | 30 | // d = V3 |
| 31 | // zig-clap> .\example.exe -pdV=4 | ||
| 32 | // d = V=4 | ||
| 33 | // zig-clap> .\example.exe -p -dV=5 | ||
| 34 | // d = V=5 | ||
| 35 | |||
| 31 | pub fn main() !void { | 36 | pub fn main() !void { |
| 32 | const parser = comptime Clap(Options).init( | 37 | const parser = comptime Clap(Options).init( |
| 33 | Options { | 38 | Options { |