From cc056cf4232721b62b76428d1ada447eecd98421 Mon Sep 17 00:00:00 2001 From: Jimmi Holst Christensen Date: Thu, 5 Mar 2020 23:24:36 +0100 Subject: Add clap.usage --- example/README.md.template | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'example/README.md.template') diff --git a/example/README.md.template b/example/README.md.template index 1fd90b0..d1d45e5 100644 --- a/example/README.md.template +++ b/example/README.md.template @@ -87,3 +87,26 @@ The `helpEx` is the generic version of `help`. It can print a help message for a The `helpFull` is even more generic, allowing the functions that get the help and value strings to return errors and take a context as a parameter. + +### `usage` + +The `usage`, `usageEx` and `usageFull` are functions for printing a simple list of all parameters the +program can take. + +```zig +{} +``` + +``` +[-hv] [--value ] +``` + +The `usage` functions are the simplest to call. It only takes an `OutStream` and a slice of +`Param(Help)`. + +The `usageEx` is the generic version of `usage`. It can print a usage message for any +`Param` give that the caller provides functions for getting the usage and value strings. + +The `usageFull` is even more generic, allowing the functions that get the usage and value strings +to return errors and take a context as a parameter. + -- cgit v1.2.3 From ca4b720d1b99f217559fe52d2be2146514d406a3 Mon Sep 17 00:00:00 2001 From: Jimmi Holst Christensen Date: Thu, 5 Mar 2020 23:28:11 +0100 Subject: Better readme for usage --- example/README.md.template | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) (limited to 'example/README.md.template') diff --git a/example/README.md.template b/example/README.md.template index d1d45e5..5e75d5d 100644 --- a/example/README.md.template +++ b/example/README.md.template @@ -90,8 +90,8 @@ to return errors and take a context as a parameter. ### `usage` -The `usage`, `usageEx` and `usageFull` are functions for printing a simple list of all parameters the -program can take. +The `usage`, `usageEx` and `usageFull` are functions for printing a small abbreviated version +of the help message. ```zig {} @@ -101,12 +101,3 @@ program can take. [-hv] [--value ] ``` -The `usage` functions are the simplest to call. It only takes an `OutStream` and a slice of -`Param(Help)`. - -The `usageEx` is the generic version of `usage`. It can print a usage message for any -`Param` give that the caller provides functions for getting the usage and value strings. - -The `usageFull` is even more generic, allowing the functions that get the usage and value strings -to return errors and take a context as a parameter. - -- cgit v1.2.3