Skip to content

Clap flags not working with bool value #3

@DCjanus

Description

@DCjanus

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);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions