Skip to content

Commit d6a8b3b

Browse files
committed
cli: error on unknown option with prefix -/--
1 parent bfb5421 commit d6a8b3b

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/main.zig

+1
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ pub fn main() !void {
116116
} else if (p.flag2("verbose")) {
117117
opts.verbose = true;
118118
} else {
119+
if (std.mem.startsWith(u8, p.next_arg, "-")) fatal("unknown option: {s}", .{p.next_arg});
119120
if (filename != null) fatal("too many positional arguments specified", .{});
120121
filename = p.next_arg;
121122
}

0 commit comments

Comments
 (0)