Fix ShellOption with required

- Take 2
- Fix case with optional.
- Fixes #436
This commit is contained in:
Janne Valkealahti
2022-06-02 09:55:55 +01:00
parent f7992a682e
commit 2ba288cb54
2 changed files with 24 additions and 1 deletions

View File

@@ -140,7 +140,7 @@ public class StandardMethodTargetRegistrar implements MethodTargetRegistrar, App
&& !ObjectUtils.nullSafeEquals(so.defaultValue(), ShellOption.NULL)) {
optionSpec.defaultValue(so.defaultValue());
}
else {
if (ObjectUtils.nullSafeEquals(so.defaultValue(), ShellOption.NONE)) {
optionSpec.required();
}
}