From f968d56d96989d1c74664449f509d7d1b2e3010f Mon Sep 17 00:00:00 2001 From: Jimmi Holst Christensen Date: Wed, 14 Nov 2018 14:25:42 +0100 Subject: Added pub flag/option/positional init funcs to Param --- example/comptime-clap.zig | 6 +++--- example/streaming-clap.zig | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'example') 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 { // * A "Names" struct, which determins what names the parameter will have on the // commandline. Names.prefix inits a "Names" struct that has the "short" name // set to the first letter, and the "long" name set to the full name. - clap.Param(void).init({}, false, clap.Names.prefix("help")), - clap.Param(void).init({}, true, clap.Names.prefix("number")), + clap.Param(void).flag({}, clap.Names.prefix("help")), + clap.Param(void).option({}, clap.Names.prefix("number")), // Names.positional returns a "Names" struct where neither the "short" or "long" // name is set. - clap.Param(void).init({}, true, clap.Names.positional()), + clap.Param(void).positional({}), }; // 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 { // * A "Names" struct, which determins what names the parameter will have on the // commandline. Names.prefix inits a "Names" struct that has the "short" name // set to the first letter, and the "long" name set to the full name. - clap.Param(u8).init('h', false, clap.Names.prefix("help")), - clap.Param(u8).init('n', true, clap.Names.prefix("number")), + clap.Param(u8).flag('h', clap.Names.prefix("help")), + clap.Param(u8).option('n', clap.Names.prefix("number")), // Names.positional returns a "Names" struct where neither the "short" or "long" // name is set. - clap.Param(u8).init('f', true, clap.Names.positional()), + clap.Param(u8).positional('f'), }; // We then initialize an argument iterator. We will use the OsIterator as it nicely -- cgit v1.2.3