-
I apologize if this has been asked before but I can't seem to find a way to disable the default help "short" option. Command elfdump: Short option names must be unique for each argument, but '-h' is in use by both 'header' and 'he
lp' (call `cmd.disable_help_flag(true)` to remove the auto-generated `--help`) I've tried to define my own help arg: #[derive(Parser)]
#[command(version, about, long_about = None)]
pub struct ElfDump {
pub name: Option<String>,
#[clap(long, action = clap::ArgAction::HelpLong)]
help: Option<bool>,
#[arg(short, long)]
pub header: Option<PathBuf>
} But this just ends up conflicting with the default long help option. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
You got part of the hint in that output
The next is how to use that in the derive API. In the derive reference, it talks about "raw attributes" which will map directly to builder methods. That means you can use |
Beta Was this translation helpful? Give feedback.
You got part of the hint in that output
The next is how to use that in the derive API. In the derive reference, it talks about "raw attributes" which will map directly to builder methods. That means you can use
#[command(disable_help_flag = true)]
. #4090 is where we are exploring improving this.