From 8e1eb2324692bf32b79eb8ae374ad80b9ed89bd3 Mon Sep 17 00:00:00 2001 From: Yuya Nishihara Date: Sat, 2 Nov 2024 10:52:18 +0900 Subject: [PATCH] cli: remove special case for clap's default "help" subcommand Since 536c629d "cli: Explicitly add a Help command to accept the early args after it", "jj help" is a normal subcommand. --- cli/src/cli_util.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cli/src/cli_util.rs b/cli/src/cli_util.rs index 9ce97f321..9f730d8bb 100644 --- a/cli/src/cli_util.rs +++ b/cli/src/cli_util.rs @@ -2908,7 +2908,7 @@ fn resolve_default_command( app: &Command, mut string_args: Vec, ) -> Result, CommandError> { - const PRIORITY_FLAGS: &[&str] = &["help", "--help", "-h", "--version", "-V"]; + const PRIORITY_FLAGS: &[&str] = &["--help", "-h", "--version", "-V"]; let has_priority_flag = string_args .iter() @@ -3033,7 +3033,6 @@ fn handle_early_args( .clone() .disable_version_flag(true) .disable_help_flag(true) - .disable_help_subcommand(true) .ignore_errors(true) .try_get_matches_from(args)?; let mut args: EarlyArgs = EarlyArgs::from_arg_matches(&early_matches).unwrap();