You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I have a bool flag and set default_value = "false", it defaults to true. Even though it works if I don't set any default value, this is a bit confusing:
#[macro_use]externcrate structopt;use structopt::StructOpt;#[derive(Debug,StructOpt)]structOpts{/// Flag that is always true even when not set explicitly.#[structopt(short = "f", long = "flag", default_value = "false")]flag:bool,}fnmain(){println!("{:?}", Opts::from_args());}
This prints (if I don't pass any arguments at all):
Opts { flag: true }
I'd suggest to this either work as expected (eg. defaulting to false) or erroring,
This is structopt 0.2.5.
The text was updated successfully, but these errors were encountered:
Hello
If I have a bool flag and set
default_value = "false"
, it defaults to true. Even though it works if I don't set any default value, this is a bit confusing:This prints (if I don't pass any arguments at all):
I'd suggest to this either work as expected (eg. defaulting to false) or erroring,
This is structopt 0.2.5.
The text was updated successfully, but these errors were encountered: