Closed nstinus closed 2 years ago
Try #[structopt(settings = &[structopt::clap::AppSettings::AllowNegativeNumbers])]
on a top level field.
For example:
use structopt::clap::AppSettings;
use structopt::StructOpt;
#[derive(StructOpt, Debug)]
pub enum Subcommand {
// ...
#[structopt(alias = "bri", settings = &[AppSettings::AllowNegativeNumbers])]
Brightness {
brightness: String,
lights: Vec<String>,
},
// ...
}
Yeah, allow_hypen_values is for options, not for args.
Also, please provide a complete compiling example when you have a question, explaining the actual behavior and the expected behavior. It will be much easier to understand the question.
Hi,
I am trying to allow an i32 positional argument and I can't parse negative inputs. I have tried using
to no avail.
I'll greatly appreciate any help.
Thanks!