From c06c93608cb3befe77c78ba25c70b14db6f7b319 Mon Sep 17 00:00:00 2001 From: Jimmi Holst Christensen Date: Fri, 25 Feb 2022 19:44:52 +0100 Subject: Revert "Change clap into generating a struct" This reverts commit cfaac64c404fb1c2e892880410aa3b7dd881ea58. --- example/help.zig | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'example/help.zig') diff --git a/example/help.zig b/example/help.zig index 2e7ca2b..de3b707 100644 --- a/example/help.zig +++ b/example/help.zig @@ -3,16 +3,16 @@ const std = @import("std"); pub fn main() !void { const params = comptime [_]clap.Param(clap.Help){ - clap.untyped.parseParam("-h, --help Display this help and exit. ") catch unreachable, - clap.untyped.parseParam("-v, --version Output version information and exit.") catch unreachable, + clap.parseParam("-h, --help Display this help and exit. ") catch unreachable, + clap.parseParam("-v, --version Output version information and exit.") catch unreachable, }; - var res = try clap.untyped.parse(clap.Help, ¶ms, .{}); - defer res.deinit(); + var args = try clap.parse(clap.Help, ¶ms, .{}); + defer args.deinit(); // clap.help is a function that can print a simple help message, given a // slice of Param(Help). There is also a helpEx, which can print a // help message for any Param, but it is more verbose to call. - if (res.args.help) + if (args.flag("--help")) return clap.help(std.io.getStdErr().writer(), ¶ms); } -- cgit v1.2.3