From 093d29899b8fdf449b944e973b07b5992be2144a Mon Sep 17 00:00:00 2001 From: Komari Spaghetti Date: Mon, 2 Nov 2020 18:04:30 +0000 Subject: Report error context in Diagnostic (#26) --- example/simple-error.zig | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'example/simple-error.zig') diff --git a/example/simple-error.zig b/example/simple-error.zig index 2c403fc..3c62f0e 100644 --- a/example/simple-error.zig +++ b/example/simple-error.zig @@ -2,13 +2,11 @@ const std = @import("std"); const clap = @import("clap"); pub fn main() !void { - // First we specify what parameters our program can take. - // We can use `parseParam` to parse a string to a `Param(Help)` const params = comptime [_]clap.Param(clap.Help){ clap.parseParam("-h, --help Display this help and exit.") catch unreachable, }; - var args = try clap.parse(clap.Help, ¶ms, std.heap.direct_allocator); + var args = try clap.parse(clap.Help, ¶ms, std.heap.direct_allocator, null); defer args.deinit(); _ = args.flag("--helps"); -- cgit v1.2.3