summaryrefslogtreecommitdiff
path: root/src/core.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/core.zig')
-rw-r--r--src/core.zig6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/core.zig b/src/core.zig
index 5e47714..f2e1fe0 100644
--- a/src/core.zig
+++ b/src/core.zig
@@ -266,8 +266,10 @@ pub fn Clap(comptime Id: type, comptime ArgError: type) type {
266 kind = ArgInfo.Kind.Short; 266 kind = ArgInfo.Kind.Short;
267 } 267 }
268 268
269 if (arg.len == 0) 269 // We allow long arguments to go without a name.
270 return error.ArgWithNoName; 270 // This allows the user to use "--" for something important
271 if (kind != ArgInfo.Kind.Long and arg.len == 0)
272 return error.InvalidArgument;
271 273
272 break :blk ArgInfo { .arg = arg, .kind = kind }; 274 break :blk ArgInfo { .arg = arg, .kind = kind };
273 }; 275 };