summaryrefslogtreecommitdiff
path: root/example/help.zig
diff options
context:
space:
mode:
Diffstat (limited to 'example/help.zig')
-rw-r--r--example/help.zig8
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 @@
1const clap = @import("clap");
2const std = @import("std");
3
4pub fn main() !void { 1pub 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, &params, .{}); 21 return clap.help(std.io.getStdErr().writer(), clap.Help, &params, .{});
25} 22}
23
24const clap = @import("clap");
25const std = @import("std");