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

Help message alignment inconsistent when using .multiple(true) #702

Closed
mattcl opened this issue Oct 24, 2016 · 3 comments
Closed

Help message alignment inconsistent when using .multiple(true) #702

mattcl opened this issue Oct 24, 2016 · 3 comments
Labels
A-help Area: documentation, including docs.rs, readme, examples, etc... C-bug Category: Updating dependencies

Comments

@mattcl
Copy link

mattcl commented Oct 24, 2016

Given the following code and clap version 2.16.0
OS is Ubuntu 14.04
TERM=xterm-256color

extern crate clap;
use clap::{App, Arg};

fn main() {
    let matches = App::new("MyApp")
        .version("1.0")
        .author("foo")
        .about("bar")
        .arg(Arg::with_name("some")
             .help("some option")
             .short("s")
             .long("some")
             .takes_value(true))
        .arg(Arg::with_name("other")
             .help("some other option")
             .short("o")
             .long("other")
             .takes_value(true))
        .arg(Arg::with_name("label")
             .help("a label")
             .short("l")
             .long("label")
             .multiple(true)
             .takes_value(true))
        .get_matches();
}

running clap-test --help yields

MyApp 1.0
foo
bar

USAGE:
    clap-test [OPTIONS]

FLAGS:
    -h, --help       Prints help information
    -V, --version    Prints version information

OPTIONS:
    -l, --label <label>    a label
    -o, --other <other>       some other option
    -s, --some <some>         some option

Note the missing padding before "a label"

Whereas removing the .multiple(true) yields

MyApp 1.0
foo
bar

USAGE:
    clap-test [OPTIONS]

FLAGS:
    -h, --help       Prints help information
    -V, --version    Prints version information

OPTIONS:
    -l, --label <label>    a label
    -o, --other <other>    some other option
    -s, --some <some>      some option
@kbknapp
Copy link
Member

kbknapp commented Oct 24, 2016

Thanks for filing this! I should have this fixed shortly 😉

@kbknapp kbknapp added C-bug Category: Updating dependencies P2: need to have A-help Area: documentation, including docs.rs, readme, examples, etc... labels Oct 24, 2016
@kbknapp
Copy link
Member

kbknapp commented Oct 24, 2016

@mattcl This is fixed in #703 once that merges I'll put up v2.16.1 on crates.io

@homu homu closed this as completed in ebddac7 Oct 24, 2016
@mattcl
Copy link
Author

mattcl commented Oct 24, 2016

Thanks for the quick turnaround!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-help Area: documentation, including docs.rs, readme, examples, etc... C-bug Category: Updating dependencies
Projects
None yet
Development

No branches or pull requests

2 participants