-
Notifications
You must be signed in to change notification settings - Fork 446
Closed
Labels
theme: usagehelpAn issue or change related to the usage help messageAn issue or change related to the usage help messagetype: bug 🐛
Milestone
Description
When having a ArgGroup with multiplicity 0..1, the usage shows options as required, but they should not. Here's an example code (I'm running picocli version 4.6.1):
@Command(requiredOptionMarker = '*')
public class RequiredMarkerDisplayedIncorrectly {
public static class ExclusiveOptions {
@Option(names = "--silent",
description = "Silent mode",
required = false
)
public boolean silent;
@Option(names = {"-v","--verbose"},
description = "Verbose mode",
required = false)
public boolean verbose;
}
@ArgGroup(exclusive = true, multiplicity = "0..1")
public ExclusiveOptions exclusive;
public static void main(String[] args) {
new CommandLine(new RequiredMarkerDisplayedIncorrectly()).usage(System.out);
}
}The output is this:
Usage: <main class> [--silent | -v]
* --silent Silent/quiet mode
* -v, --verbose Verbose mode
Metadata
Metadata
Assignees
Labels
theme: usagehelpAn issue or change related to the usage help messageAn issue or change related to the usage help messagetype: bug 🐛