groovy-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Remko Popma <>
Subject Feedback on groovy.cli.Option annotation
Date Sat, 24 Mar 2018 01:46:58 GMT
The groovy.cli.Option annotation currently has three attributes for
modeling the number of arguments (arity) of an option:

   - boolean optionalArg() default false
   - int numberOfArguments() default 1
   - String numberOfArgumentsString() default ""

Are we open to changing this to a single attribute where the number of
arguments can be expressed as a range?

For example, "0..1" for a single optional argument, "0..*" (or simply "*")
for an option with any number of arguments, "1..*" (or "+") for one or more
arguments. This would also allow users specifying ranges like "2..4" for an
option that has at least 2 but at most 4 arguments.

Having a single attribute instead of three is cleaner and simpler IMO. Is
it too late to make this change?


View raw message