summaryrefslogtreecommitdiff
path: root/clap.zig
diff options
context:
space:
mode:
Diffstat (limited to 'clap.zig')
-rw-r--r--clap.zig18
1 files changed, 18 insertions, 0 deletions
diff --git a/clap.zig b/clap.zig
index 54bcb32..00f195b 100644
--- a/clap.zig
+++ b/clap.zig
@@ -899,6 +899,24 @@ fn Positionals(
899 if (longest.kind != .positional) 899 if (longest.kind != .positional)
900 continue; 900 continue;
901 901
902 if ((i + 1) != fields_len and param.takes_value == .many) {
903 @compileError(
904 \\Only the last positional is allowed to take multiple values
905 \\This works:
906 \\ <usize>
907 \\ <str>
908 \\ <str>...
909 \\
910 \\This doesn't:
911 \\ <usize>
912 \\ <str>...
913 \\ <str>
914 \\
915 \\See https://github.com/Hejsil/zig-clap/issues/153
916 \\
917 );
918 }
919
902 const T = ParamType(Id, param, value_parsers); 920 const T = ParamType(Id, param, value_parsers);
903 const FieldT = switch (param.takes_value) { 921 const FieldT = switch (param.takes_value) {
904 .none => continue, 922 .none => continue,