summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--clap.zig6
1 files changed, 6 insertions, 0 deletions
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
1733 try cs.writeAll("<"); 1733 try cs.writeAll("<");
1734 try cs.writeAll(p.id.value()); 1734 try cs.writeAll(p.id.value());
1735 try cs.writeAll(">"); 1735 try cs.writeAll(">");
1736 if (p.takes_value == .many)
1737 try cs.writeAll("...");
1736 } 1738 }
1737} 1739}
1738 1740
@@ -1769,6 +1771,10 @@ test "usage" {
1769 \\<file> 1771 \\<file>
1770 \\ 1772 \\
1771 )); 1773 ));
1774 try testUsage("<file>...", &comptime parseParamsComptime(
1775 \\<file>...
1776 \\
1777 ));
1772 try testUsage( 1778 try testUsage(
1773 "[-ab] [-c <value>] [-d <v>] [--e] [--f] [--g <value>] [--h <v>] [-i <v>...] <file>", 1779 "[-ab] [-c <value>] [-d <v>] [--e] [--f] [--g <value>] [--h <v>] [-i <v>...] <file>",
1774 &comptime parseParamsComptime( 1780 &comptime parseParamsComptime(