-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Labels
A-deriveArea: #[derive]` macro APIArea: #[derive]` macro APIC-bugCategory: bugCategory: bugS-waiting-on-designStatus: Waiting on user-facing design to be resolved before implementingStatus: Waiting on user-facing design to be resolved before implementing
Description
Please complete the following tasks
- I have searched the discussions
- I have searched the open and rejected issues
Rust Version
1.90
Clap Version
4.5.48
Minimal reproducible code
use clap::Parser;
use clap::Subcommand;
#[derive(Parser)]
struct App {
#[clap(subcommand)]
command: Command,
}
#[derive(Clone, Debug, Subcommand)]
enum Command {
Inner {
#[clap(long, short)]
foo: i32,
#[clap(subcommand)]
inner: Config,
}
}
#[derive(Clone, Debug, Subcommand)]
enum Config {
#[clap(subcommand)]
Show,
#[clap(subcommand)]
Edit,
}
fn main() {
App::parse_from(&["app", "inner", "--foo", "12", "show"]);
}
Steps to reproduce the bug with the above code
Run playground
Actual Behaviour
Prints help text, which indicates the exact same that was passed
Expected Behaviour
Parses CLI correctly
Additional Context
No response
Debug Output
No response
Metadata
Metadata
Assignees
Labels
A-deriveArea: #[derive]` macro APIArea: #[derive]` macro APIC-bugCategory: bugCategory: bugS-waiting-on-designStatus: Waiting on user-facing design to be resolved before implementingStatus: Waiting on user-facing design to be resolved before implementing