summaryrefslogtreecommitdiff
path: root/example/simple-ex.zig
diff options
context:
space:
mode:
Diffstat (limited to 'example/simple-ex.zig')
-rw-r--r--example/simple-ex.zig11
1 files changed, 6 insertions, 5 deletions
diff --git a/example/simple-ex.zig b/example/simple-ex.zig
index 7ab8d1e..f6a1c7f 100644
--- a/example/simple-ex.zig
+++ b/example/simple-ex.zig
@@ -1,6 +1,10 @@
1pub fn main() !void { 1pub fn main() !void {
2 var gpa = std.heap.DebugAllocator(.{}){}; 2 var gpa_state = std.heap.DebugAllocator(.{}){};
3 defer _ = gpa.deinit(); 3 const gpa = gpa_state.allocator();
4 defer _ = gpa_state.deinit();
5
6 var threaded: std.Io.Threaded = .init_single_threaded;
7 const io: std.Io = threaded.io();
4 8
5 // First we specify what parameters our program can take. 9 // First we specify what parameters our program can take.
6 // We can use `parseParamsComptime` to parse a string into an array of `Param(Help)`. 10 // We can use `parseParamsComptime` to parse a string into an array of `Param(Help)`.
@@ -23,9 +27,6 @@ pub fn main() !void {
23 .ANSWER = clap.parsers.enumeration(YesNo), 27 .ANSWER = clap.parsers.enumeration(YesNo),
24 }; 28 };
25 29
26 var threaded: std.Io.Threaded = .init_single_threaded;
27 const io: std.Io = threaded.io();
28
29 var diag = clap.Diagnostic{}; 30 var diag = clap.Diagnostic{};
30 var res = clap.parse(clap.Help, &params, parsers, .{ 31 var res = clap.parse(clap.Help, &params, parsers, .{
31 .diagnostic = &diag, 32 .diagnostic = &diag,