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