summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'README.md')
-rw-r--r--README.md14
1 files changed, 4 insertions, 10 deletions
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 {
48 48
49 // We then initialize an argument iterator. We will use the OsIterator as it nicely 49 // We then initialize an argument iterator. We will use the OsIterator as it nicely
50 // wraps iterating over arguments the most efficient way on each os. 50 // wraps iterating over arguments the most efficient way on each os.
51 var iter = clap.args.OsIterator.init(allocator); 51 var iter = try clap.args.OsIterator.init(allocator);
52 defer iter.deinit(); 52 defer iter.deinit();
53 53
54 // Consume the exe arg. 54 // Initialize our streaming parser.
55 const exe = try iter.next();
56
57 // Finally we initialize our streaming parser.
58 var parser = clap.StreamingClap(u8, clap.args.OsIterator){ 55 var parser = clap.StreamingClap(u8, clap.args.OsIterator){
59 .params = params, 56 .params = params,
60 .iter = &iter, 57 .iter = &iter,
@@ -104,13 +101,10 @@ pub fn main() !void {
104 101
105 // We then initialize an argument iterator. We will use the OsIterator as it nicely 102 // We then initialize an argument iterator. We will use the OsIterator as it nicely
106 // wraps iterating over arguments the most efficient way on each os. 103 // wraps iterating over arguments the most efficient way on each os.
107 var iter = clap.args.OsIterator.init(allocator); 104 var iter = try clap.args.OsIterator.init(allocator);
108 defer iter.deinit(); 105 defer iter.deinit();
109 106
110 // Consume the exe arg. 107 // Parse the arguments
111 const exe = try iter.next();
112
113 // Finally we can parse the arguments
114 var args = try clap.ComptimeClap(clap.Help, params).parse(allocator, clap.args.OsIterator, &iter); 108 var args = try clap.ComptimeClap(clap.Help, params).parse(allocator, clap.args.OsIterator, &iter);
115 defer args.deinit(); 109 defer args.deinit();
116 110