TeXitoi / structopt

Parse command line arguments by defining a struct.
Other
2.71k stars 151 forks source link

Assigning `short` changes nothing. #478

Closed Milo123459 closed 3 years ago

Milo123459 commented 3 years ago

Hello!

I had some code like this:

    /// if the branch is not on the hosted provider, call this
    #[structopt(long, short = "nh")]
    pub(crate) nohost: Option<Option<bool>>,

and I thought that the short would be -nh, but no, it's still -n as the short. Any ideas why?

TeXitoi commented 3 years ago

https://docs.rs/clap/2.33.3/clap/struct.Arg.html#method.short

short is one character, allowing -fn to be the same as -f -n