Fix invalid CLI argument does not abort parsing
Invalid argument, such as "d foo" should abort and prints usage error.
Changes
1 changed files
(+4/-1)
-
-
if (self.command.parseArg(arg, args)) |_| {
return;
-
} else |_| {}
+
} else |err| switch (err) {
+
ParseArgsError.UnknownArg => {},
+
else => return err,
+
}
if (std.mem.eql(u8, "--debug", arg)) {
self.debug = true;
- Authored by
-
Shota FUJI
- Authored at
-
- Committed by
-
Shota FUJI
- Committed at
-
- Signature
-
View
- Object name
- 304fec8bc7cd0c5856a5085295395c1461cab525
- Parent
-
5be27e01
- Tab width
-