summaryrefslogtreecommitdiff
path: root/example/help.zig
diff options
context:
space:
mode:
Diffstat (limited to 'example/help.zig')
-rw-r--r--example/help.zig10
1 files changed, 5 insertions, 5 deletions
diff --git a/example/help.zig b/example/help.zig
index de3b707..2e7ca2b 100644
--- a/example/help.zig
+++ b/example/help.zig
@@ -3,16 +3,16 @@ const std = @import("std");
3 3
4pub fn main() !void { 4pub fn main() !void {
5 const params = comptime [_]clap.Param(clap.Help){ 5 const params = comptime [_]clap.Param(clap.Help){
6 clap.parseParam("-h, --help Display this help and exit. ") catch unreachable, 6 clap.untyped.parseParam("-h, --help Display this help and exit. ") catch unreachable,
7 clap.parseParam("-v, --version Output version information and exit.") catch unreachable, 7 clap.untyped.parseParam("-v, --version Output version information and exit.") catch unreachable,
8 }; 8 };
9 9
10 var args = try clap.parse(clap.Help, &params, .{}); 10 var res = try clap.untyped.parse(clap.Help, &params, .{});
11 defer args.deinit(); 11 defer res.deinit();
12 12
13 // clap.help is a function that can print a simple help message, given a 13 // clap.help is a function that can print a simple help message, given a
14 // slice of Param(Help). There is also a helpEx, which can print a 14 // slice of Param(Help). There is also a helpEx, which can print a
15 // help message for any Param, but it is more verbose to call. 15 // help message for any Param, but it is more verbose to call.
16 if (args.flag("--help")) 16 if (res.args.help)
17 return clap.help(std.io.getStdErr().writer(), &params); 17 return clap.help(std.io.getStdErr().writer(), &params);
18} 18}