picocli
picocli copied to clipboard
Add IDefaultValuesProvider API for multi-value default provider
Related to #879 and #877:
If new annotations are added to support multi-value default/fallback values, then it makes sense to add new API that provides the multi-value equivalent of the IDefaultProvider
interface. Something like this:
public interface IDefaultValuesProvider {
String[] defaultValue(ArgSpec argSpec) throws Exception; // or List<String>?
}
To be explored:
- return type:
String[]
array or somejava.util
collection likeList<String>
? - use existing
@Command(defaultValueProvider)
annotation or add separate@Command(defaultValuesProvider)
annotation? - name: is
IDefaultValuesProvider
too similar to the existingIDefaultProvider
interface? (If we choose to reuse the existing@Command(defaultValueProvider)
annotation then wouldIDefaultValueProvider2 extends IDefaultProvider
be better?) - Other...?
While the #877 ticket only mentions PropertiesDefaultProvider
,