summaryrefslogtreecommitdiff
path: root/example/comptime-clap.zig
diff options
context:
space:
mode:
authorGravatar Jimmi Holst Christensen2019-11-09 13:12:34 +0100
committerGravatar Jimmi Holst Christensen2019-11-09 13:12:34 +0100
commitdc1431c20883677f8176033ed2fb8ee4360a1b8e (patch)
tree179651a820cfcc031f597091620d8e381a6e26cb /example/comptime-clap.zig
parentfmt, mv src/ clap/ and run fmt on build (diff)
downloadzig-clap-dc1431c20883677f8176033ed2fb8ee4360a1b8e.tar.gz
zig-clap-dc1431c20883677f8176033ed2fb8ee4360a1b8e.tar.xz
zig-clap-dc1431c20883677f8176033ed2fb8ee4360a1b8e.zip
Breaking: OsIterator will now get the exe on init
Diffstat (limited to '')
-rw-r--r--example/comptime-clap.zig7
1 files changed, 2 insertions, 5 deletions
diff --git a/example/comptime-clap.zig b/example/comptime-clap.zig
index 8e0eb12..4d0ace3 100644
--- a/example/comptime-clap.zig
+++ b/example/comptime-clap.zig
@@ -18,13 +18,10 @@ pub fn main() !void {
18 18
19 // We then initialize an argument iterator. We will use the OsIterator as it nicely 19 // 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. 20 // wraps iterating over arguments the most efficient way on each os.
21 var iter = clap.args.OsIterator.init(allocator); 21 var iter = try clap.args.OsIterator.init(allocator);
22 defer iter.deinit(); 22 defer iter.deinit();
23 23
24 // Consume the exe arg. 24 // Parse the arguments
25 const exe = try iter.next();
26
27 // Finally we can parse the arguments
28 var args = try clap.ComptimeClap(clap.Help, params).parse(allocator, clap.args.OsIterator, &iter); 25 var args = try clap.ComptimeClap(clap.Help, params).parse(allocator, clap.args.OsIterator, &iter);
29 defer args.deinit(); 26 defer args.deinit();
30 27