diff options
Diffstat (limited to 'example/usage.zig')
| -rw-r--r-- | example/usage.zig | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/example/usage.zig b/example/usage.zig index 25e1a34..e044f1d 100644 --- a/example/usage.zig +++ b/example/usage.zig | |||
| @@ -1,14 +1,12 @@ | |||
| 1 | const std = @import("std"); | ||
| 2 | const clap = @import("clap"); | 1 | const clap = @import("clap"); |
| 2 | const std = @import("std"); | ||
| 3 | 3 | ||
| 4 | pub fn main() !void { | 4 | pub fn main() !void { |
| 5 | const stderr = std.io.getStdErr().outStream(); | ||
| 6 | |||
| 7 | // clap.usage is a function that can print a simple usage message, given a | 5 | // clap.usage is a function that can print a simple usage message, given a |
| 8 | // slice of Param(Help). There is also a usageEx, which can print a | 6 | // slice of Param(Help). There is also a usageEx, which can print a |
| 9 | // usage message for any Param, but it is more verbose to call. | 7 | // usage message for any Param, but it is more verbose to call. |
| 10 | try clap.usage( | 8 | try clap.usage( |
| 11 | stderr, | 9 | std.io.getStdErr().writer(), |
| 12 | comptime &[_]clap.Param(clap.Help){ | 10 | comptime &[_]clap.Param(clap.Help){ |
| 13 | clap.parseParam("-h, --help Display this help and exit. ") catch unreachable, | 11 | clap.parseParam("-h, --help Display this help and exit. ") catch unreachable, |
| 14 | clap.parseParam("-v, --version Output version information and exit.") catch unreachable, | 12 | clap.parseParam("-v, --version Output version information and exit.") catch unreachable, |