From dc1431c20883677f8176033ed2fb8ee4360a1b8e Mon Sep 17 00:00:00 2001 From: Jimmi Holst Christensen Date: Sat, 9 Nov 2019 13:12:34 +0100 Subject: Breaking: OsIterator will now get the exe on init --- README.md | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index ce83cf0..6c556b9 100644 --- a/README.md +++ b/README.md @@ -48,13 +48,10 @@ pub fn main() !void { // We then initialize an argument iterator. We will use the OsIterator as it nicely // wraps iterating over arguments the most efficient way on each os. - var iter = clap.args.OsIterator.init(allocator); + var iter = try clap.args.OsIterator.init(allocator); defer iter.deinit(); - // Consume the exe arg. - const exe = try iter.next(); - - // Finally we initialize our streaming parser. + // Initialize our streaming parser. var parser = clap.StreamingClap(u8, clap.args.OsIterator){ .params = params, .iter = &iter, @@ -104,13 +101,10 @@ pub fn main() !void { // We then initialize an argument iterator. We will use the OsIterator as it nicely // wraps iterating over arguments the most efficient way on each os. - var iter = clap.args.OsIterator.init(allocator); + var iter = try clap.args.OsIterator.init(allocator); defer iter.deinit(); - // Consume the exe arg. - const exe = try iter.next(); - - // Finally we can parse the arguments + // Parse the arguments var args = try clap.ComptimeClap(clap.Help, params).parse(allocator, clap.args.OsIterator, &iter); defer args.deinit(); -- cgit v1.2.3