diff options
| author | 2020-03-05 23:28:11 +0100 | |
|---|---|---|
| committer | 2020-03-05 23:28:11 +0100 | |
| commit | ca4b720d1b99f217559fe52d2be2146514d406a3 (patch) | |
| tree | 1eaa42e4a1d62023a529ced937720f72157763f2 | |
| parent | Add clap.usage (diff) | |
| download | zig-clap-ca4b720d1b99f217559fe52d2be2146514d406a3.tar.gz zig-clap-ca4b720d1b99f217559fe52d2be2146514d406a3.tar.xz zig-clap-ca4b720d1b99f217559fe52d2be2146514d406a3.zip | |
Better readme for usage
Diffstat (limited to '')
| -rw-r--r-- | README.md | 13 | ||||
| -rw-r--r-- | example/README.md.template | 13 |
2 files changed, 4 insertions, 22 deletions
| @@ -235,8 +235,8 @@ to return errors and take a context as a parameter. | |||
| 235 | 235 | ||
| 236 | ### `usage` | 236 | ### `usage` |
| 237 | 237 | ||
| 238 | The `usage`, `usageEx` and `usageFull` are functions for printing a simple list of all parameters the | 238 | The `usage`, `usageEx` and `usageFull` are functions for printing a small abbreviated version |
| 239 | program can take. | 239 | of the help message. |
| 240 | 240 | ||
| 241 | ```zig | 241 | ```zig |
| 242 | const std = @import("std"); | 242 | const std = @import("std"); |
| @@ -266,12 +266,3 @@ pub fn main() !void { | |||
| 266 | [-hv] [--value <N>] | 266 | [-hv] [--value <N>] |
| 267 | ``` | 267 | ``` |
| 268 | 268 | ||
| 269 | The `usage` functions are the simplest to call. It only takes an `OutStream` and a slice of | ||
| 270 | `Param(Help)`. | ||
| 271 | |||
| 272 | The `usageEx` is the generic version of `usage`. It can print a usage message for any | ||
| 273 | `Param` give that the caller provides functions for getting the usage and value strings. | ||
| 274 | |||
| 275 | The `usageFull` is even more generic, allowing the functions that get the usage and value strings | ||
| 276 | to return errors and take a context as a parameter. | ||
| 277 | |||
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. | |||
| 90 | 90 | ||
| 91 | ### `usage` | 91 | ### `usage` |
| 92 | 92 | ||
| 93 | The `usage`, `usageEx` and `usageFull` are functions for printing a simple list of all parameters the | 93 | The `usage`, `usageEx` and `usageFull` are functions for printing a small abbreviated version |
| 94 | program can take. | 94 | of the help message. |
| 95 | 95 | ||
| 96 | ```zig | 96 | ```zig |
| 97 | {} | 97 | {} |
| @@ -101,12 +101,3 @@ program can take. | |||
| 101 | [-hv] [--value <N>] | 101 | [-hv] [--value <N>] |
| 102 | ``` | 102 | ``` |
| 103 | 103 | ||
| 104 | The `usage` functions are the simplest to call. It only takes an `OutStream` and a slice of | ||
| 105 | `Param(Help)`. | ||
| 106 | |||
| 107 | The `usageEx` is the generic version of `usage`. It can print a usage message for any | ||
| 108 | `Param` give that the caller provides functions for getting the usage and value strings. | ||
| 109 | |||
| 110 | The `usageFull` is even more generic, allowing the functions that get the usage and value strings | ||
| 111 | to return errors and take a context as a parameter. | ||
| 112 | |||