diff options
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 12 |
1 files changed, 8 insertions, 4 deletions
| @@ -200,7 +200,8 @@ is generated at runtime. | |||
| 200 | 200 | ||
| 201 | The `help` prints a simple list of all parameters the program can take. It expects the | 201 | The `help` prints a simple list of all parameters the program can take. It expects the |
| 202 | `Id` to have a `description` method and an `value` method so that it can provide that | 202 | `Id` to have a `description` method and an `value` method so that it can provide that |
| 203 | in the output. | 203 | in the output. `HelpOptions` is passed to `help` to control how the help message is |
| 204 | printed. | ||
| 204 | 205 | ||
| 205 | ```zig | 206 | ```zig |
| 206 | const clap = @import("clap"); | 207 | const clap = @import("clap"); |
| @@ -220,15 +221,18 @@ pub fn main() !void { | |||
| 220 | // slice of Param(Help). There is also a helpEx, which can print a | 221 | // slice of Param(Help). There is also a helpEx, which can print a |
| 221 | // help message for any Param, but it is more verbose to call. | 222 | // help message for any Param, but it is more verbose to call. |
| 222 | if (res.args.help) | 223 | if (res.args.help) |
| 223 | return clap.help(std.io.getStdErr().writer(), clap.Help, ¶ms); | 224 | return clap.help(std.io.getStdErr().writer(), clap.Help, ¶ms, .{}); |
| 224 | } | 225 | } |
| 225 | 226 | ||
| 226 | ``` | 227 | ``` |
| 227 | 228 | ||
| 228 | ``` | 229 | ``` |
| 229 | $ zig-out/bin/help --help | 230 | $ zig-out/bin/help --help |
| 230 | -h, --help Display this help and exit. | 231 | -h, --help |
| 231 | -v, --version Output version information and exit. | 232 | Display this help and exit. |
| 233 | |||
| 234 | -v, --version | ||
| 235 | Output version information and exit. | ||
| 232 | ``` | 236 | ``` |
| 233 | 237 | ||
| 234 | ### `usage` | 238 | ### `usage` |