Fix method argument without ShellOption
- For annotated methods with arguments, change default arity to zero with booleans and one everything else regardless if @ShellOption is defined or not. - OptionArity.ZERO_OR_ONE had wrong upperbound value, change from MAX to 1. - These modification should take us a bit closer to old shell functionality and what ShellOption documents for arity. - For old functionality I'm referring to method `add(int a, int b)` and/or having @ShellOption and/or without arity setting. - Fixes #446
This commit is contained in:
@@ -608,7 +608,7 @@ public interface CommandRegistration {
|
||||
break;
|
||||
case ZERO_OR_ONE:
|
||||
this.arityMin = 0;
|
||||
this.arityMax = Integer.MAX_VALUE;
|
||||
this.arityMax = 1;
|
||||
break;
|
||||
case EXACTLY_ONE:
|
||||
this.arityMin = 1;
|
||||
|
||||
Reference in New Issue
Block a user