Skip to content

Commit

Permalink
cli: remove special case for clap's default "help" subcommand
Browse files Browse the repository at this point in the history
Since 536c629 "cli: Explicitly add a Help command to accept the early args
after it", "jj help" is a normal subcommand.
  • Loading branch information
yuja committed Nov 2, 2024
1 parent f251f08 commit 76d4b59
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions cli/src/cli_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2908,7 +2908,7 @@ fn resolve_default_command(
app: &Command,
mut string_args: Vec<String>,
) -> Result<Vec<String>, 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()
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 76d4b59

Please sign in to comment.