multiple occurrences with limit of occurrence times
gwttk opened this issue · comments
It could be very useful if we can force the size of resulted arrays.
for example
@Option(names = { "-f" }, size = "2")
public String[] file;
@Option(names = { "-d" }, size = "1..3")
public String[] dir;
So the file array must be a size of 2. dir array can be [1,3].
-d DIR1 -f FILE1 -d DIR2 -f FILE2
Yes, I have considered supporting this in the annotations API but this is very straightforward to implement in your application by throwing a ParameterException
(see Custom Validation), and I decided to put my effort towards other things.
Yes, I have considered supporting this in the annotations API but this is very straightforward to implement in your application by throwing a
ParameterException
(see Custom Validation), and I decided to put my effort towards other things.
ParameterException
! OK you convinced me.