From 984c22948b70bd1cbfef9f2d514d42e27541c1f1 Mon Sep 17 00:00:00 2001 From: Jimmi Holst Christensen Date: Wed, 30 Mar 2022 16:28:16 +0200 Subject: New `help` api that provides options as to how paramters are printed. fixes \#28 --- README.md | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index 85d944f..25199e2 100644 --- a/README.md +++ b/README.md @@ -200,7 +200,8 @@ is generated at runtime. The `help` prints a simple list of all parameters the program can take. It expects the `Id` to have a `description` method and an `value` method so that it can provide that -in the output. +in the output. `HelpOptions` is passed to `help` to control how the help message is +printed. ```zig const clap = @import("clap"); @@ -220,15 +221,18 @@ pub fn main() !void { // slice of Param(Help). There is also a helpEx, which can print a // help message for any Param, but it is more verbose to call. if (res.args.help) - return clap.help(std.io.getStdErr().writer(), clap.Help, ¶ms); + return clap.help(std.io.getStdErr().writer(), clap.Help, ¶ms, .{}); } ``` ``` $ zig-out/bin/help --help - -h, --help Display this help and exit. - -v, --version Output version information and exit. + -h, --help + Display this help and exit. + + -v, --version + Output version information and exit. ``` ### `usage` -- cgit v1.2.3