Please support fallbackValue with "zero-based" arities other than 0..1, in particular with 0..*.
To see why this might be useful, consider the following @Option definition:
enum DebugFacility { FOO, BAR, BAZ, ALL }
@Option(
names = { "--debug" },
paramLabel = "FACILITY", //
split = ",",
arity = "0..*", //
fallbackValue = "ALL", //
description = "The facilities for which to log debug information (one or more of ${COMPLETION-CANDIDATES}). "
+ "If none are given, debug information will be logged for ${FALLBACK-VALUE} categories.")
public void setDebugFacilities(Collection<DebugFacility> facilities) { ... }
This should support the following scenarios
--debug FOO -> FOO
--debug FOO --debug BAR -> FOO, BAR
--debug FOO,BAR -> FOO, BAR
--debug all -> ALL (i.e., FOO, BAR, BAZ)
--debug -> ALL (i.e., FOO, BAR, BAZ)
The last one unfortunately doesn't work, as the fallbackValue does not get passed to setDebugFacilities; it merely gets an empty facilities Collection.
And we can't insert ALL programmatically in setDebugFacilities, either. To see why, consider the following scenario:
--debug FOO --debug -> ALL (i.e., FOO, BAR, BAZ)
Here, the parameterless --debug simply results in another call of setDebugFacilities with FOO as single parameter. In other words, one cannot detect the parameterless case
Maybe there is a workaround that I am unable to see, but IMHO fallbackValue support for any "zero-based" arity might be the most idiomatic solution. WDYT?
Please support
fallbackValuewith "zero-based" arities other than0..1, in particular with0..*.To see why this might be useful, consider the following
@Optiondefinition:This should support the following scenarios
The last one unfortunately doesn't work, as the
fallbackValuedoes not get passed tosetDebugFacilities; it merely gets an emptyfacilitiesCollection.And we can't insert
ALLprogrammatically insetDebugFacilities, either. To see why, consider the following scenario:Here, the parameterless
--debugsimply results in another call ofsetDebugFacilitieswithFOOas single parameter. In other words, one cannot detect the parameterless caseMaybe there is a workaround that I am unable to see, but IMHO
fallbackValuesupport for any "zero-based" arity might be the most idiomatic solution. WDYT?