Register option without prefix
- While option should be defined i.e. using "--arg", discover prefix from ShellMethod#prefix and use that if just "arg" is defined. - Fixes #575
This commit is contained in:
@@ -119,6 +119,14 @@ public class StandardMethodTargetRegistrar implements MethodTargetRegistrar, App
|
||||
else if (o.length() == stripped.length() + 1 && stripped.length() == 1) {
|
||||
shortNames.add(stripped.charAt(0));
|
||||
}
|
||||
else if (o.length() == stripped.length()) {
|
||||
if ("--".equals(shellMapping.prefix())) {
|
||||
longNames.add(stripped);
|
||||
}
|
||||
else if ("-".equals(shellMapping.prefix()) && stripped.length() == 1) {
|
||||
shortNames.add(stripped.charAt(0));
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
else {
|
||||
|
||||
Reference in New Issue
Block a user