kotlinx-cli icon indicating copy to clipboard operation
kotlinx-cli copied to clipboard

Fix default value for lists

Open BarkingBad opened this issue 5 years ago • 1 comments

This condition is wrong, empty list should be permitted to be default value as all other concrete values can be. And in my case it is default value. What's more this condition didn't prevent other collections from having default value of empty collection e. g. Set, Map, Collection.

I am talking about SingleNullableOption, not MultipleOption, where it is clearly stated that it can't have emtpy collection, though I don't know why

BarkingBad avatar May 14 '20 08:05 BarkingBad

It's done by design. MultipleOption when it doesn't set by user stores empty list. Why do you need setting default value as empty list if it's already empty list? If there is nothing provided for this option in command line you get empty list without any defaults.

I am talking about SingleNullableOption

SingleNullableOption stores null value if no value is provided in command line. Other types of collections isn't supported, only lists for several values.

LepilkinaElena avatar May 15 '20 10:05 LepilkinaElena