mirror of
https://github.com/lightpanda-io/browser.git
synced 2026-06-11 01:25:53 -04:00
Merge pull request #2243 from lightpanda-io/exit_on_cli_error
Propagate CLI parsing errors
This commit is contained in:
@@ -405,7 +405,7 @@ pub fn Builder(comptime commands: anytype) type {
|
||||
error.Overflow => log.fatal(.app, "range overflow", .{ .arg = kebab_cased, .value = str }),
|
||||
error.InvalidCharacter => log.fatal(.app, "invalid character", .{ .arg = kebab_cased, .value = str }),
|
||||
}
|
||||
continue :iter_args;
|
||||
return error.InvalidArgument;
|
||||
};
|
||||
|
||||
if (is_multiple) {
|
||||
@@ -481,6 +481,7 @@ pub fn Builder(comptime commands: anytype) type {
|
||||
|
||||
// Invalid option choice.
|
||||
log.fatal(.app, "invalid option choice", .{ .arg = kebab_cased, .value = trimmed });
|
||||
return error.InvalidArgument;
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -493,7 +494,7 @@ pub fn Builder(comptime commands: anytype) type {
|
||||
const str = args.next() orelse return error.MissingArgument;
|
||||
const v = std.meta.stringToEnum(E, str) orelse {
|
||||
log.fatal(.app, "invalid option choice", .{ .arg = kebab_cased, .value = str });
|
||||
continue :iter_args;
|
||||
return error.InvalidArgument;
|
||||
};
|
||||
|
||||
if (is_multiple) {
|
||||
|
||||
Reference in New Issue
Block a user