diff options
| author | 2020-11-10 18:31:35 +0100 | |
|---|---|---|
| committer | 2020-11-10 18:31:35 +0100 | |
| commit | cc0885a2fd8c4bbfbf8ffbe6e31a8d0540fec495 (patch) | |
| tree | d025ff320915d560a720716a77a652ff63026ff4 /README.md | |
| parent | Improve Diagnostic error message reporting (diff) | |
| download | zig-clap-cc0885a2fd8c4bbfbf8ffbe6e31a8d0540fec495.tar.gz zig-clap-cc0885a2fd8c4bbfbf8ffbe6e31a8d0540fec495.tar.xz zig-clap-cc0885a2fd8c4bbfbf8ffbe6e31a8d0540fec495.zip | |
Better parseParam
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 8 |
1 files changed, 2 insertions, 6 deletions
| @@ -37,9 +37,7 @@ pub fn main() !void { | |||
| 37 | clap.parseParam("-h, --help Display this help and exit. ") catch unreachable, | 37 | clap.parseParam("-h, --help Display this help and exit. ") catch unreachable, |
| 38 | clap.parseParam("-n, --number <NUM> An option parameter, which takes a value.") catch unreachable, | 38 | clap.parseParam("-n, --number <NUM> An option parameter, which takes a value.") catch unreachable, |
| 39 | clap.parseParam("-s, --string <STR>... An option parameter which can be specified multiple times.") catch unreachable, | 39 | clap.parseParam("-s, --string <STR>... An option parameter which can be specified multiple times.") catch unreachable, |
| 40 | clap.Param(clap.Help){ | 40 | clap.parseParam("<POS>...") catch unreachable, |
| 41 | .takes_value = .One, | ||
| 42 | }, | ||
| 43 | }; | 41 | }; |
| 44 | 42 | ||
| 45 | // Initalize our diagnostics, which can be used for reporting useful errors. | 43 | // Initalize our diagnostics, which can be used for reporting useful errors. |
| @@ -121,9 +119,7 @@ pub fn main() !void { | |||
| 121 | clap.parseParam("-h, --help Display this help and exit. ") catch unreachable, | 119 | clap.parseParam("-h, --help Display this help and exit. ") catch unreachable, |
| 122 | clap.parseParam("-n, --number <NUM> An option parameter, which takes a value.") catch unreachable, | 120 | clap.parseParam("-n, --number <NUM> An option parameter, which takes a value.") catch unreachable, |
| 123 | clap.parseParam("-s, --string <STR>... An option parameter which can be specified multiple times.") catch unreachable, | 121 | clap.parseParam("-s, --string <STR>... An option parameter which can be specified multiple times.") catch unreachable, |
| 124 | clap.Param(clap.Help){ | 122 | clap.parseParam("<POS>...") catch unreachable, |
| 125 | .takes_value = .One, | ||
| 126 | }, | ||
| 127 | }; | 123 | }; |
| 128 | const Clap = clap.ComptimeClap(clap.Help, clap.args.OsIterator, ¶ms); | 124 | const Clap = clap.ComptimeClap(clap.Help, clap.args.OsIterator, ¶ms); |
| 129 | 125 | ||