summaryrefslogtreecommitdiff
path: root/example
diff options
context:
space:
mode:
Diffstat (limited to 'example')
-rw-r--r--example/README.md.template10
-rw-r--r--example/help.zig2
2 files changed, 8 insertions, 4 deletions
diff --git a/example/README.md.template b/example/README.md.template
index b76ae45..8b12cd6 100644
--- a/example/README.md.template
+++ b/example/README.md.template
@@ -58,7 +58,8 @@ is generated at runtime.
58 58
59The `help` prints a simple list of all parameters the program can take. It expects the 59The `help` prints a simple list of all parameters the program can take. It expects the
60`Id` to have a `description` method and an `value` method so that it can provide that 60`Id` to have a `description` method and an `value` method so that it can provide that
61in the output. 61in the output. `HelpOptions` is passed to `help` to control how the help message is
62printed.
62 63
63```zig 64```zig
64{s} 65{s}
@@ -66,8 +67,11 @@ in the output.
66 67
67``` 68```
68$ zig-out/bin/help --help 69$ zig-out/bin/help --help
69 -h, --help Display this help and exit. 70 -h, --help
70 -v, --version Output version information and exit. 71 Display this help and exit.
72
73 -v, --version
74 Output version information and exit.
71``` 75```
72 76
73### `usage` 77### `usage`
diff --git a/example/help.zig b/example/help.zig
index 64d1709..18d61b9 100644
--- a/example/help.zig
+++ b/example/help.zig
@@ -15,5 +15,5 @@ pub fn main() !void {
15 // slice of Param(Help). There is also a helpEx, which can print a 15 // slice of Param(Help). There is also a helpEx, which can print a
16 // help message for any Param, but it is more verbose to call. 16 // help message for any Param, but it is more verbose to call.
17 if (res.args.help) 17 if (res.args.help)
18 return clap.help(std.io.getStdErr().writer(), clap.Help, &params); 18 return clap.help(std.io.getStdErr().writer(), clap.Help, &params, .{});
19} 19}