From 56e7be2835311888ef43f403e5d6bc2118c953fe Mon Sep 17 00:00:00 2001 From: Jimmi HC Date: Fri, 21 Jun 2019 19:15:32 +0200 Subject: Embed examples in README during build fixes #11 --- example/comptime-clap.zig | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'example/comptime-clap.zig') diff --git a/example/comptime-clap.zig b/example/comptime-clap.zig index 935381f..695fa62 100644 --- a/example/comptime-clap.zig +++ b/example/comptime-clap.zig @@ -13,7 +13,7 @@ pub fn main() !void { defer direct_allocator.deinit(); // First we specify what parameters our program can take. - const params = comptime [_]clap.Param([]const u8){ + const params = [_]clap.Param([]const u8){ clap.Param([]const u8){ .id = "Display this help and exit.", .names = clap.Names{ .short = 'h', .long = "help" }, @@ -41,11 +41,8 @@ pub fn main() !void { var args = try clap.ComptimeClap([]const u8, params).parse(allocator, clap.args.OsIterator, &iter); defer args.deinit(); - // clap.help is a function that can print a simple help message, given a - // slice of Param([]const u8). There is also a helpEx, which can print a - // help message for any Param, but it is more verbose to call. if (args.flag("--help")) - return try clap.help(stdout, params); + debug.warn("--help\n"); if (args.option("--number")) |n| debug.warn("--number = {}\n", n); for (args.positionals()) |pos| -- cgit v1.2.3