You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As of 1.0.1, arity on a list/array field is treated by picocli as a global max.
If more values are put into the list/array for any reason, a MaxValuesforFieldExceededException exception is thrown. This should not happen.
Example
For example, if a collection or array option is defined with arity="1":
class Args {
@Option(names = "-o", arity="1")
List<String> strings;
}
Current (incorrect)
Currently picocli (incorrectly) throws an exception if the option is specified multiple times:
<command> -o AA -o BB -o CC
# results in MaxValuesforFieldExceededException ...
Correct
Arity defines the number of parameters that the option takes. The option itself can be specified multiple times:
<command> -o AA -o BB -o CC
assert strings.size() == 3
The text was updated successfully, but these errors were encountered:
As of 1.0.1, arity on a list/array field is treated by picocli as a global max.
If more values are put into the list/array for any reason, a MaxValuesforFieldExceededException exception is thrown. This should not happen.
Example
For example, if a collection or array option is defined with arity="1":
Current (incorrect)
Currently picocli (incorrectly) throws an exception if the option is specified multiple times:
Correct
Arity defines the number of parameters that the option takes. The option itself can be specified multiple times:
The text was updated successfully, but these errors were encountered: