summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--README.md12
1 files changed, 5 insertions, 7 deletions
diff --git a/README.md b/README.md
index 297764c..ce83cf0 100644
--- a/README.md
+++ b/README.md
@@ -133,14 +133,12 @@ const std = @import("std");
133const clap = @import("clap"); 133const clap = @import("clap");
134 134
135pub fn main() !void { 135pub fn main() !void {
136 const allocator = std.heap.direct_allocator;
137
136 const params = [_]clap.Param(void){clap.Param(void){ 138 const params = [_]clap.Param(void){clap.Param(void){
137 .names = clap.Names{ .short = 'h', .long = "help" }, 139 .names = clap.Names{ .short = 'h', .long = "help" },
138 }}; 140 }};
139 141
140 var direct_allocator = std.heap.DirectAllocator.init();
141 const allocator = &direct_allocator.allocator;
142 defer direct_allocator.deinit();
143
144 var iter = clap.args.OsIterator.init(allocator); 142 var iter = clap.args.OsIterator.init(allocator);
145 defer iter.deinit(); 143 defer iter.deinit();
146 const exe = try iter.next(); 144 const exe = try iter.next();
@@ -154,13 +152,13 @@ pub fn main() !void {
154``` 152```
155 153
156``` 154```
157zig-clap/src/comptime.zig:116:17: error: --helps is not a parameter. 155zig-clap/src/comptime.zig:109:17: error: --helps is not a parameter.
158 @compileError(name ++ " is not a parameter."); 156 @compileError(name ++ " is not a parameter.");
159 ^ 157 ^
160zig-clap/src/comptime.zig:84:45: note: called from here 158zig-clap/src/comptime.zig:77:45: note: called from here
161 const param = comptime findParam(name); 159 const param = comptime findParam(name);
162 ^ 160 ^
163zig-clap/example/comptime-clap-error.zig:22:18: note: called from here 161zig-clap/example/comptime-clap-error.zig:18:18: note: called from here
164 _ = args.flag("--helps"); 162 _ = args.flag("--helps");
165 ^ 163 ^
166``` 164```