From 996821a3e1f186c9e5cdfd971d742c9815ea590e Mon Sep 17 00:00:00 2001 From: Jimmi Holst Christensen Date: Thu, 28 Apr 2022 19:00:17 +0200 Subject: Print multi value positionals correctly in `usage` --- clap.zig | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/clap.zig b/clap.zig index 6432352..6d8e399 100644 --- a/clap.zig +++ b/clap.zig @@ -1733,6 +1733,8 @@ pub fn usage(stream: anytype, comptime Id: type, params: []const Param(Id)) !voi try cs.writeAll("<"); try cs.writeAll(p.id.value()); try cs.writeAll(">"); + if (p.takes_value == .many) + try cs.writeAll("..."); } } @@ -1769,6 +1771,10 @@ test "usage" { \\ \\ )); + try testUsage("...", &comptime parseParamsComptime( + \\... + \\ + )); try testUsage( "[-ab] [-c ] [-d ] [--e] [--f] [--g ] [--h ] [-i ...] ", &comptime parseParamsComptime( -- cgit v1.2.3