-
Notifications
You must be signed in to change notification settings - Fork 446
Description
We have an ArgGroup defined like the following:
@ArgGroup(exclusive = false, multiplicity = "1", order = 1)
@Getter private UrlConfigOptions urlConfigOptions;
class UrlConfigOptions {
@Option(names = {"--url"}, required = true, order=1)
@Getter private String url;
@Option(names = {"--proxy-host"}, required = false, order=2)
@Getter private String proxyHost;
@Option(names = {"--proxy-port"}, required = false, order=3)
@Getter private Integer proxyPort;
@Option(names = {"--proxy-user"}, required = false, order=4)
@Getter private String proxyUser;
@Option(names = {"--proxy-password"}, required = false, interactive = true, echo = false, order=5)
@Getter private char[] proxyPassword;
@Option(names = {"--insecure", "-k"}, required = false, description = "Disable SSL checks", defaultValue = "false", order=6)
@Getter private Boolean insecureModeEnabled;
}This usually works as expected, with picocli requiring at least the --url option and the other options being optional, with a synopsis like the following:
(--url=<url> [--proxy-host=<proxyHost>] [--proxy-port=<proxyPort>] [--proxy-user=<proxyUser>] [--proxy-password]... [-k])
However, if we configure a global default value provider (in our case retrieving default values from environment variables), the synopsis changes to the following, indicating that --url is now optional:
([--url=<url>] [--proxy-host=<proxyHost>] [--proxy-port=<proxyPort>] [--proxy-user=<proxyUser>] [--proxy-password]... [-k])
Due to multiplicitly = "1" on the ArgGroup, picocli still requires at least one of the options in the ArgGroup to be specified on the command line, even though the required --url option is already being satisfied through the default value provider.
Any suggestions on how to get this fixed?