summaryrefslogtreecommitdiff
path: root/example/comptime-clap.zig
diff options
context:
space:
mode:
authorGravatar Jimmi HC2019-06-12 15:30:30 +0200
committerGravatar Jimmi HC2019-06-12 15:30:30 +0200
commit44ea38f25453fbf51de72505d7b3ddb0f3eec13c (patch)
tree2ffd0fc94f65270f9f94edab940641b388ff3f16 /example/comptime-clap.zig
parenttried to fix travis (diff)
downloadzig-clap-44ea38f25453fbf51de72505d7b3ddb0f3eec13c.tar.gz
zig-clap-44ea38f25453fbf51de72505d7b3ddb0f3eec13c.tar.xz
zig-clap-44ea38f25453fbf51de72505d7b3ddb0f3eec13c.zip
updated to newest version of zig
Diffstat (limited to '')
-rw-r--r--example/comptime-clap.zig24
1 files changed, 14 insertions, 10 deletions
diff --git a/example/comptime-clap.zig b/example/comptime-clap.zig
index 8d2d8a8..935381f 100644
--- a/example/comptime-clap.zig
+++ b/example/comptime-clap.zig
@@ -13,16 +13,20 @@ pub fn main() !void {
13 defer direct_allocator.deinit(); 13 defer direct_allocator.deinit();
14 14
15 // First we specify what parameters our program can take. 15 // First we specify what parameters our program can take.
16 const params = comptime []clap.Param([]const u8){ 16 const params = comptime [_]clap.Param([]const u8){
17 clap.Param([]const u8).flag( 17 clap.Param([]const u8){
18 "Display this help and exit.", 18 .id = "Display this help and exit.",
19 clap.Names.both("help"), 19 .names = clap.Names{ .short = 'h', .long = "help" },
20 ), 20 },
21 clap.Param([]const u8).option( 21 clap.Param([]const u8){
22 "An option parameter, which takes a value.", 22 .id = "An option parameter, which takes a value.",
23 clap.Names.both("number"), 23 .names = clap.Names{ .short = 'n', .long = "number" },
24 ), 24 .takes_value = true,
25 clap.Param([]const u8).positional(""), 25 },
26 clap.Param([]const u8){
27 .id = "",
28 .takes_value = true,
29 },
26 }; 30 };
27 31
28 // We then initialize an argument iterator. We will use the OsIterator as it nicely 32 // We then initialize an argument iterator. We will use the OsIterator as it nicely