Closed malaow3 closed 1 month ago
Following the examples in the readme, trying to print the subcommand help displays nothing.
pub fn main() !void { var gpa = std.heap.GeneralPurposeAllocator(.{}){}; defer _ = gpa.deinit(); const allocator = gpa.allocator(); var app = App.init(allocator, "myapp", "My app description"); defer app.deinit(); var root = app.rootCommand(); var subcmd = app.createCommand("subcmd", "Subcommand description"); try subcmd.addArg(Arg.booleanOption("verbose", 'v', "Enable verbose output")); try root.addSubcommand(subcmd); const matches = try app.parseProcess(); if (matches.subcommandMatches("subcmd")) |subcmd_matches| { if (!subcmd_matches.containsArgs()) { try app.displaySubcommandHelp(); return; } } }
./zig-out/bin/example subcmd
Hi, this is now fixed :)
Following the examples in the readme, trying to print the subcommand help displays nothing.