From 5166a15378a9c32d9b680417807000ba65d06141 Mon Sep 17 00:00:00 2001 From: Jimmi Holst Christensen Date: Wed, 23 Mar 2022 20:05:28 +0100 Subject: Add parseParams and friends --- example/help.zig | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'example/help.zig') diff --git a/example/help.zig b/example/help.zig index f3edb58..64d1709 100644 --- a/example/help.zig +++ b/example/help.zig @@ -2,10 +2,11 @@ const clap = @import("clap"); const std = @import("std"); pub fn main() !void { - const params = comptime [_]clap.Param(clap.Help){ - clap.parseParam("-h, --help Display this help and exit. ") catch unreachable, - clap.parseParam("-v, --version Output version information and exit.") catch unreachable, - }; + const params = comptime clap.parseParamsComptime( + \\-h, --help Display this help and exit. + \\-v, --version Output version information and exit. + \\ + ); var res = try clap.parse(clap.Help, ¶ms, clap.parsers.default, .{}); defer res.deinit(); -- cgit v1.2.3