diff options
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 12 |
1 files changed, 4 insertions, 8 deletions
| @@ -404,14 +404,10 @@ pub fn main() !void { | |||
| 404 | }); | 404 | }); |
| 405 | defer res.deinit(); | 405 | defer res.deinit(); |
| 406 | 406 | ||
| 407 | // `clap.usage` is a function that can print a simple help message. It can print any `Param` | 407 | // `clap.usageToFile` is a function that can print a simple usage string. It can print any |
| 408 | // where `Id` has a `value` method (`Param(Help)` is one such parameter). | 408 | // `Param` where `Id` has a `value` method (`Param(Help)` is one such parameter). |
| 409 | if (res.args.help != 0) { | 409 | if (res.args.help != 0) |
| 410 | var buf: [1024]u8 = undefined; | 410 | return clap.usage(.stdout(), clap.Help, ¶ms); |
| 411 | var stderr = std.fs.File.stderr().writer(&buf); | ||
| 412 | try clap.usage(&stderr.interface, clap.Help, ¶ms); | ||
| 413 | return stderr.interface.flush(); | ||
| 414 | } | ||
| 415 | } | 411 | } |
| 416 | 412 | ||
| 417 | const clap = @import("clap"); | 413 | const clap = @import("clap"); |