diff options
Diffstat (limited to '')
| -rw-r--r-- | example/help.zig | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/example/help.zig b/example/help.zig index 2f063c5..b80ee35 100644 --- a/example/help.zig +++ b/example/help.zig | |||
| @@ -1,6 +1,3 @@ | |||
| 1 | const clap = @import("clap"); | ||
| 2 | const std = @import("std"); | ||
| 3 | |||
| 4 | pub fn main() !void { | 1 | pub fn main() !void { |
| 5 | var gpa = std.heap.GeneralPurposeAllocator(.{}){}; | 2 | var gpa = std.heap.GeneralPurposeAllocator(.{}){}; |
| 6 | defer _ = gpa.deinit(); | 3 | defer _ = gpa.deinit(); |
| @@ -17,9 +14,12 @@ pub fn main() !void { | |||
| 17 | defer res.deinit(); | 14 | defer res.deinit(); |
| 18 | 15 | ||
| 19 | // `clap.help` is a function that can print a simple help message. It can print any `Param` | 16 | // `clap.help` is a function that can print a simple help message. It can print any `Param` |
| 20 | // where `Id` has a `describtion` and `value` method (`Param(Help)` is one such parameter). | 17 | // where `Id` has a `description` and `value` method (`Param(Help)` is one such parameter). |
| 21 | // The last argument contains options as to how `help` should print those parameters. Using | 18 | // The last argument contains options as to how `help` should print those parameters. Using |
| 22 | // `.{}` means the default options. | 19 | // `.{}` means the default options. |
| 23 | if (res.args.help != 0) | 20 | if (res.args.help != 0) |
| 24 | return clap.help(std.io.getStdErr().writer(), clap.Help, ¶ms, .{}); | 21 | return clap.help(std.io.getStdErr().writer(), clap.Help, ¶ms, .{}); |
| 25 | } | 22 | } |
| 23 | |||
| 24 | const clap = @import("clap"); | ||
| 25 | const std = @import("std"); | ||