Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

help command is skipped when set ignore_errors(true) on the command. #5919

Open
epage opened this issue Feb 19, 2025 · 2 comments
Open

help command is skipped when set ignore_errors(true) on the command. #5919

epage opened this issue Feb 19, 2025 · 2 comments
Labels
A-parsing Area: Parser's logic and needs it changed somehow. C-bug Category: bug E-medium Call for participation: Experience needed to fix: Medium / intermediate

Comments

@epage
Copy link
Member

epage commented Feb 19, 2025

Discussed in #5917

Originally posted by chungquantin February 18, 2025

Dependencies

clap = { version = "4.5", features = ["derive"] }

Description

Hi, considering the below code:

#[derive(Args)]
- #[command(args_conflicts_with_subcommands = true)]
+ #[command(args_conflicts_with_subcommands = true, ignore_errors = true)]
pub struct Cli {
	#[command(subcommand)]
	pub command: Command,
}

#[derive(Subcommand)]
pub enum Command {
	#[clap(alias = "p")]
	SubCommand(SubCommandA),
}

By adding the ignore_errors, the help command of the SubCommandA is no longer working.

How to reproduce an issue?

Add ignore_errors to any Command that contains the Subcommand (does have help).

CC @chungquantin

@epage epage added C-bug Category: bug A-parsing Area: Parser's logic and needs it changed somehow. E-medium Call for participation: Experience needed to fix: Medium / intermediate labels Feb 19, 2025
@imtherealnaska
Copy link

Hi, is anybody working on this issue ? I would like to pick this up

@epage
Copy link
Member Author

epage commented Feb 20, 2025

Go for it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-parsing Area: Parser's logic and needs it changed somehow. C-bug Category: bug E-medium Call for participation: Experience needed to fix: Medium / intermediate
Projects
None yet
Development

No branches or pull requests

2 participants