summaryrefslogtreecommitdiff
path: root/example
diff options
context:
space:
mode:
authorGravatar Jimmi Holst Christensen2018-11-14 14:25:42 +0100
committerGravatar Jimmi Holst Christensen2018-11-14 14:25:42 +0100
commitf968d56d96989d1c74664449f509d7d1b2e3010f (patch)
tree0b9f51b379af7a80b578d7e0459b680fb926bf0f /example
parentRestructured and make StreamingClap simpler (diff)
downloadzig-clap-f968d56d96989d1c74664449f509d7d1b2e3010f.tar.gz
zig-clap-f968d56d96989d1c74664449f509d7d1b2e3010f.tar.xz
zig-clap-f968d56d96989d1c74664449f509d7d1b2e3010f.zip
Added pub flag/option/positional init funcs to Param
Diffstat (limited to 'example')
-rw-r--r--example/comptime-clap.zig6
-rw-r--r--example/streaming-clap.zig6
2 files changed, 6 insertions, 6 deletions
diff --git a/example/comptime-clap.zig b/example/comptime-clap.zig
index e44d9b1..3b7b42b 100644
--- a/example/comptime-clap.zig
+++ b/example/comptime-clap.zig
@@ -17,12 +17,12 @@ pub fn main() !void {
17 // * A "Names" struct, which determins what names the parameter will have on the 17 // * A "Names" struct, which determins what names the parameter will have on the
18 // commandline. Names.prefix inits a "Names" struct that has the "short" name 18 // commandline. Names.prefix inits a "Names" struct that has the "short" name
19 // set to the first letter, and the "long" name set to the full name. 19 // set to the first letter, and the "long" name set to the full name.
20 clap.Param(void).init({}, false, clap.Names.prefix("help")), 20 clap.Param(void).flag({}, clap.Names.prefix("help")),
21 clap.Param(void).init({}, true, clap.Names.prefix("number")), 21 clap.Param(void).option({}, clap.Names.prefix("number")),
22 22
23 // Names.positional returns a "Names" struct where neither the "short" or "long" 23 // Names.positional returns a "Names" struct where neither the "short" or "long"
24 // name is set. 24 // name is set.
25 clap.Param(void).init({}, true, clap.Names.positional()), 25 clap.Param(void).positional({}),
26 }; 26 };
27 27
28 // We then initialize an argument iterator. We will use the OsIterator as it nicely 28 // We then initialize an argument iterator. We will use the OsIterator as it nicely
diff --git a/example/streaming-clap.zig b/example/streaming-clap.zig
index 0dc2bf7..013c1d4 100644
--- a/example/streaming-clap.zig
+++ b/example/streaming-clap.zig
@@ -17,12 +17,12 @@ pub fn main() !void {
17 // * A "Names" struct, which determins what names the parameter will have on the 17 // * A "Names" struct, which determins what names the parameter will have on the
18 // commandline. Names.prefix inits a "Names" struct that has the "short" name 18 // commandline. Names.prefix inits a "Names" struct that has the "short" name
19 // set to the first letter, and the "long" name set to the full name. 19 // set to the first letter, and the "long" name set to the full name.
20 clap.Param(u8).init('h', false, clap.Names.prefix("help")), 20 clap.Param(u8).flag('h', clap.Names.prefix("help")),
21 clap.Param(u8).init('n', true, clap.Names.prefix("number")), 21 clap.Param(u8).option('n', clap.Names.prefix("number")),
22 22
23 // Names.positional returns a "Names" struct where neither the "short" or "long" 23 // Names.positional returns a "Names" struct where neither the "short" or "long"
24 // name is set. 24 // name is set.
25 clap.Param(u8).init('f', true, clap.Names.positional()), 25 clap.Param(u8).positional('f'),
26 }; 26 };
27 27
28 // We then initialize an argument iterator. We will use the OsIterator as it nicely 28 // We then initialize an argument iterator. We will use the OsIterator as it nicely