summaryrefslogtreecommitdiff
path: root/example/simple.zig
diff options
context:
space:
mode:
Diffstat (limited to 'example/simple.zig')
-rw-r--r--example/simple.zig4
1 files changed, 3 insertions, 1 deletions
diff --git a/example/simple.zig b/example/simple.zig
index abcf448..67313aa 100644
--- a/example/simple.zig
+++ b/example/simple.zig
@@ -16,12 +16,14 @@ pub fn main() !void {
16 // This is optional. You can also pass `.{}` to `clap.parse` if you don't 16 // This is optional. You can also pass `.{}` to `clap.parse` if you don't
17 // care about the extra information `Diagnostics` provides. 17 // care about the extra information `Diagnostics` provides.
18 var diag = clap.Diagnostic{}; 18 var diag = clap.Diagnostic{};
19 var threaded: std.Io.Threaded = .init_single_threaded;
20 const io: std.Io = threaded.io();
19 var res = clap.parse(clap.Help, &params, clap.parsers.default, .{ 21 var res = clap.parse(clap.Help, &params, clap.parsers.default, .{
20 .diagnostic = &diag, 22 .diagnostic = &diag,
21 .allocator = gpa.allocator(), 23 .allocator = gpa.allocator(),
22 }) catch |err| { 24 }) catch |err| {
23 // Report useful error and exit. 25 // Report useful error and exit.
24 try diag.reportToFile(.stderr(), err); 26 try diag.reportToFile(io, .stderr(), err);
25 return err; 27 return err;
26 }; 28 };
27 defer res.deinit(); 29 defer res.deinit();