forked from mirrors/jj
cli: propagate clap error from handle_early_args()
If we fail to parse the command line, even with `ignore_errors(true)` set, we currently let clap exit the process for us because we call `get_matches_from()`. We should instead propagate any errors and exit in `CliRunner::run()` as usual..
This commit is contained in:
parent
db87cb2c39
commit
9995415440
1 changed files with 1 additions and 1 deletions
|
@ -2280,7 +2280,7 @@ fn handle_early_args(
|
|||
layered_configs: &mut LayeredConfigs,
|
||||
) -> Result<(), CommandError> {
|
||||
// ignore_errors() bypasses errors like "--help" or missing subcommand
|
||||
let early_matches = app.clone().ignore_errors(true).get_matches_from(args);
|
||||
let early_matches = app.clone().ignore_errors(true).try_get_matches_from(args)?;
|
||||
let mut args: EarlyArgs = EarlyArgs::from_arg_matches(&early_matches).unwrap();
|
||||
|
||||
if let Some(choice) = args.color {
|
||||
|
|
Loading…
Reference in a new issue