diff options
| author | 2018-11-14 14:25:42 +0100 | |
|---|---|---|
| committer | 2018-11-14 14:25:42 +0100 | |
| commit | f968d56d96989d1c74664449f509d7d1b2e3010f (patch) | |
| tree | 0b9f51b379af7a80b578d7e0459b680fb926bf0f /example/comptime-clap.zig | |
| parent | Restructured and make StreamingClap simpler (diff) | |
| download | zig-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 '')
| -rw-r--r-- | example/comptime-clap.zig | 6 |
1 files changed, 3 insertions, 3 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 |