summaryrefslogtreecommitdiff
path: root/example/simple-ex.zig
diff options
context:
space:
mode:
authorGravatar Jimmi Holst Christensen2020-11-10 18:53:57 +0100
committerGravatar Jimmi Holst Christensen2020-11-10 18:53:57 +0100
commitb7e6ebf36e2ac4314e6bff65f1d64466ea82a18a (patch)
treef979a760149f4c7a2d9b9113a872d8d7e6d56bef /example/simple-ex.zig
parentUpdate ci to use 0.7.0 (diff)
downloadzig-clap-b7e6ebf36e2ac4314e6bff65f1d64466ea82a18a.tar.gz
zig-clap-b7e6ebf36e2ac4314e6bff65f1d64466ea82a18a.tar.xz
zig-clap-b7e6ebf36e2ac4314e6bff65f1d64466ea82a18a.zip
Deprecate ComptimeClap in favor of parseExv0.3.0
Diffstat (limited to '')
-rw-r--r--example/simple-ex.zig (renamed from example/comptime-clap.zig)4
1 files changed, 1 insertions, 3 deletions
diff --git a/example/comptime-clap.zig b/example/simple-ex.zig
index e5d02ff..d6ecc44 100644
--- a/example/comptime-clap.zig
+++ b/example/simple-ex.zig
@@ -14,7 +14,6 @@ pub fn main() !void {
14 clap.parseParam("-s, --string <STR>... An option parameter which can be specified multiple times.") catch unreachable, 14 clap.parseParam("-s, --string <STR>... An option parameter which can be specified multiple times.") catch unreachable,
15 clap.parseParam("<POS>...") catch unreachable, 15 clap.parseParam("<POS>...") catch unreachable,
16 }; 16 };
17 const Clap = clap.ComptimeClap(clap.Help, clap.args.OsIterator, &params);
18 17
19 // We then initialize an argument iterator. We will use the OsIterator as it nicely 18 // We then initialize an argument iterator. We will use the OsIterator as it nicely
20 // wraps iterating over arguments the most efficient way on each os. 19 // wraps iterating over arguments the most efficient way on each os.
@@ -26,8 +25,7 @@ pub fn main() !void {
26 // don't care about the extra information `Diagnostics` provides. 25 // don't care about the extra information `Diagnostics` provides.
27 var diag: clap.Diagnostic = undefined; 26 var diag: clap.Diagnostic = undefined;
28 27
29 // Parse the arguments 28 var args = clap.parseEx(clap.Help, &params, allocator, &iter, &diag) catch |err| {
30 var args = Clap.parse(allocator, &iter, &diag) catch |err| {
31 // Report useful error and exit 29 // Report useful error and exit
32 diag.report(std.io.getStdErr().outStream(), err) catch {}; 30 diag.report(std.io.getStdErr().outStream(), err) catch {};
33 return err; 31 return err;