Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clap flags not working with bool value #3

Open
DCjanus opened this issue Jan 8, 2021 · 0 comments
Open

Clap flags not working with bool value #3

DCjanus opened this issue Jan 8, 2021 · 0 comments

Comments

@DCjanus
Copy link

DCjanus commented Jan 8, 2021

In this line, we're trying to get value from clap with method value_of, but flags like verbose would return None since it's not a string value.

let matches = clap::App::new("nabu")
    .arg(
        clap::Arg::with_name("verbose")
            .long("verbose")
            .help("Sets the level of verbosity"),
    )
    .get_matches();
viperus::load_clap(matches).unwrap();
assert_eq!(viperus::get::<bool>("verbose"), None);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant