-
Please complete the following tasks
Rust Versionrustc 1.56.1 (59eed8a2a 2021-11-01) Clap Version3.0.0-beta.5 Minimal reproducible codeuse clap::Parser;
fn main() {
Opts::parse();
}
#[derive(Parser)]
#[clap(version)]
pub struct Opts {
#[clap(subcommand)]
pub cmd: Subcommand,
}
#[derive(Debug, Parser)]
pub enum Subcommand {
/**
First line docs for subcommand foo, always shown.
Extra docs for subcommand foo, only shown in long help.
`clap_repro foo --help` -> long help (as expected)
`clap_repro foo -h` -> short help (as expected)
`clap_repro help foo` -> short help (unexpected)
Examples:
❯ clap_repro foo # Does nothing.
*/
Foo,
} (this code is at https://github.com/gibfahn/clap_repro/tree/short_help_only for ease of copying) Steps to reproduce the bug with the above codecargo run -- help foo Actual Behaviour(basing my terminology on #2983 (comment)) Clap only shows the Expected BehaviourClap should (I think) also show the Additional ContextI think users who run Debug OutputDebug output of
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
https://docs.rs/clap/3.0.0-beta.5/clap/enum.AppSettings.html#variant.UseLongFormatForHelpSubcommand - #[clap(version)]
+ #[clap(version, setting(AppSettings::UseLongFormatForHelpSubcommand))] |
Beta Was this translation helpful? Give feedback.
https://docs.rs/clap/3.0.0-beta.5/clap/enum.AppSettings.html#variant.UseLongFormatForHelpSubcommand