summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'README.md')
-rw-r--r--README.md14
1 files changed, 7 insertions, 7 deletions
diff --git a/README.md b/README.md
index 646c052..197eb4c 100644
--- a/README.md
+++ b/README.md
@@ -53,13 +53,13 @@ pub fn main() !void {
53 defer args.deinit(); 53 defer args.deinit();
54 54
55 if (args.flag("--help")) 55 if (args.flag("--help"))
56 debug.warn("--help\n", .{}); 56 debug.print("--help\n", .{});
57 if (args.option("--number")) |n| 57 if (args.option("--number")) |n|
58 debug.warn("--number = {s}\n", .{n}); 58 debug.print("--number = {s}\n", .{n});
59 for (args.options("--string")) |s| 59 for (args.options("--string")) |s|
60 debug.warn("--string = {s}\n", .{s}); 60 debug.print("--string = {s}\n", .{s});
61 for (args.positionals()) |pos| 61 for (args.positionals()) |pos|
62 debug.warn("{s}\n", .{pos}); 62 debug.print("{s}\n", .{pos});
63} 63}
64 64
65``` 65```
@@ -153,13 +153,13 @@ pub fn main() !void {
153 }) |arg| { 153 }) |arg| {
154 // arg.param will point to the parameter which matched the argument. 154 // arg.param will point to the parameter which matched the argument.
155 switch (arg.param.id) { 155 switch (arg.param.id) {
156 'h' => debug.warn("Help!\n", .{}), 156 'h' => debug.print("Help!\n", .{}),
157 'n' => debug.warn("--number = {s}\n", .{arg.value.?}), 157 'n' => debug.print("--number = {s}\n", .{arg.value.?}),
158 158
159 // arg.value == null, if arg.param.takes_value == .none. 159 // arg.value == null, if arg.param.takes_value == .none.
160 // Otherwise, arg.value is the value passed with the argument, such as "-a=10" 160 // Otherwise, arg.value is the value passed with the argument, such as "-a=10"
161 // or "-a 10". 161 // or "-a 10".
162 'f' => debug.warn("{s}\n", .{arg.value.?}), 162 'f' => debug.print("{s}\n", .{arg.value.?}),
163 else => unreachable, 163 else => unreachable,
164 } 164 }
165 } 165 }