(See also https://github.com/remkop/picocli/issues/488)
I have an application that uses a Map
field for an option:
@Option(names = "-P")
Map<String, String> properties;
so users can specify values like:
-Pmyprop=myvalue
Picocli has an option to switch off clustered short options with CommandLine.setPosixClusteredShortOptionsAllowed(false)
.
However, in that configuration, options are no longer recognized when the option value is attached to the option name. The above example -Pmyprop=myvalue
fails with an exception:
picocli.CommandLine$UnmatchedArgumentException: Unknown option: -Pmyprop=myvalue
When I separate the option name -P
and the option value (the key-value pair) with a space, the value is parsed correctly:
-P myprop=myvalue // this works
Is this the expected behaviour? IMO, map options are different from other options, and it would be useful to have the support for the former even when clustered short options are not allowed.