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

empty values aren't stored #470

Closed
kbknapp opened this issue Mar 30, 2016 · 0 comments
Closed

empty values aren't stored #470

kbknapp opened this issue Mar 30, 2016 · 0 comments
Labels
A-parsing Area: Parser's logic and needs it changed somehow. C-bug Category: Updating dependencies

Comments

@kbknapp
Copy link
Member

kbknapp commented Mar 30, 2016

extern crate clap;

use clap::{App, AppSettings};

fn main() {
    let m = App::new("test")
        .setting(AppSettings::TrailingVarArg)
        .arg_from_usage("<command>... 'some feature'")
        .get_matches();

    for c in m.values_of("command").unwrap() {
        println!("{}", c);
    }

    println!("len: {}", m.values_of("command").unwrap().collect::<Vec<_>>().len());

}

Running with

$ test ""
len: 0
@kbknapp kbknapp added C-bug Category: Updating dependencies P2: need to have A-parsing Area: Parser's logic and needs it changed somehow. labels Mar 30, 2016
@homu homu closed this as completed in 885d166 Mar 30, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-parsing Area: Parser's logic and needs it changed somehow. C-bug Category: Updating dependencies
Projects
None yet
Development

No branches or pull requests

1 participant