diff options
Diffstat (limited to 'example/simple.zig')
| -rw-r--r-- | example/simple.zig | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/example/simple.zig b/example/simple.zig index 392dca3..69473fa 100644 --- a/example/simple.zig +++ b/example/simple.zig | |||
| @@ -2,6 +2,7 @@ const clap = @import("clap"); | |||
| 2 | const std = @import("std"); | 2 | const std = @import("std"); |
| 3 | 3 | ||
| 4 | const debug = std.debug; | 4 | const debug = std.debug; |
| 5 | const io = std.io; | ||
| 5 | 6 | ||
| 6 | pub fn main() !void { | 7 | pub fn main() !void { |
| 7 | // First we specify what parameters our program can take. | 8 | // First we specify what parameters our program can take. |
| @@ -19,7 +20,7 @@ pub fn main() !void { | |||
| 19 | var diag = clap.Diagnostic{}; | 20 | var diag = clap.Diagnostic{}; |
| 20 | var args = clap.parse(clap.Help, ¶ms, .{ .diagnostic = &diag }) catch |err| { | 21 | var args = clap.parse(clap.Help, ¶ms, .{ .diagnostic = &diag }) catch |err| { |
| 21 | // Report useful error and exit | 22 | // Report useful error and exit |
| 22 | diag.report(std.io.getStdErr().outStream(), err) catch {}; | 23 | diag.report(io.getStdErr().writer(), err) catch {}; |
| 23 | return err; | 24 | return err; |
| 24 | }; | 25 | }; |
| 25 | defer args.deinit(); | 26 | defer args.deinit(); |