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

Incorrect help message for boolean options with arity 1 #612

Closed
prewersk opened this issue Jan 18, 2019 · 3 comments
Closed

Incorrect help message for boolean options with arity 1 #612

prewersk opened this issue Jan 18, 2019 · 3 comments
Milestone

Comments

@prewersk
Copy link

If we print help for the following example command

@Command(mixinStandardHelpOptions = true)
public class ExampleCommand {

  @Option(names = { "-b" }, arity = "1")
  boolean booleanWithArity1;

}

the message looks like this

Usage: <main class> [-hVb]
  -b=<booleanWithArity1>
  -h, --help                Show this help message and exit.
  -V, --version             Print version information and exit.

As we expect value for the '-b' option, I think that usage line should look like

Usage: <main class> [-hV] [-b=<booleanWithArity1>]

The problem does not occur when we define only a name with double '-' for such an option.

@Command(mixinStandardHelpOptions = true)
public class ExampleCommand {

  @Option(names = { "--b" }, arity = "1")
  boolean booleanWithArity1;

}
Usage: <main class> [-hV] [--b=<booleanWithArity1>]
      --b=<booleanWithArity1>

  -h, --help      Show this help message and exit.
  -V, --version   Print version information and exit.
@remkop
Copy link
Owner

remkop commented Jan 19, 2019

Thank you for the bug report! Looking into this.

@remkop
Copy link
Owner

remkop commented Jan 19, 2019

Fixed in master. This will be included in the upcoming 3.9.2 release.
Please verify.

@prewersk
Copy link
Author

prewersk commented Jan 19, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants