From ac5f46541ca47d3db9df0fcef3cc61731adaefab Mon Sep 17 00:00:00 2001 From: Jimmi Holst Christensen Date: Wed, 30 Mar 2022 22:04:15 +0200 Subject: Update help and usage examples --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index 25199e2..56d41c7 100644 --- a/README.md +++ b/README.md @@ -217,9 +217,10 @@ pub fn main() !void { var res = try clap.parse(clap.Help, ¶ms, clap.parsers.default, .{}); defer res.deinit(); - // clap.help is a function that can print a simple help message, given a - // 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. + // `clap.help` is a function that can print a simple help message. It can print any `Param` + // where `Id` has a `describtion` and `value` method (`Param(Help)` is one such parameter). + // The last argument contains options as to how `help` should print those parameters. Using + // `.{}` means the default options. if (res.args.help) return clap.help(std.io.getStdErr().writer(), clap.Help, ¶ms, .{}); } @@ -255,9 +256,8 @@ pub fn main() !void { var res = try clap.parse(clap.Help, ¶ms, clap.parsers.default, .{}); defer res.deinit(); - // clap.usage is a function that can print a simple usage message, given a - // slice of Param(Help). There is also a usageEx, which can print a - // usage message for any Param, but it is more verbose to call. + // `clap.usage` is a function that can print a simple help message. It can print any `Param` + // where `Id` has a `value` method (`Param(Help)` is one such parameter). if (res.args.help) return clap.usage(std.io.getStdErr().writer(), clap.Help, ¶ms); } -- cgit v1.2.3