diff --git a/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/options/OptionHandler.java b/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/options/OptionHandler.java index 6911c94190f..42cc049f02d 100644 --- a/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/options/OptionHandler.java +++ b/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/options/OptionHandler.java @@ -29,7 +29,6 @@ import java.util.Map; import java.util.Set; import java.util.TreeSet; -import groovy.lang.Closure; import joptsimple.BuiltinHelpFormatter; import joptsimple.HelpFormatter; import joptsimple.OptionDescriptor; @@ -51,8 +50,6 @@ public class OptionHandler { private OptionParser parser; - private Closure closure; - private String help; private Collection optionHelp; @@ -76,10 +73,6 @@ public class OptionHandler { protected void options() { } - public void setClosure(Closure closure) { - this.closure = closure; - } - public final ExitStatus run(String... args) throws Exception { String[] argsToUse = args.clone(); for (int i = 0; i < argsToUse.length; i++) { @@ -98,18 +91,6 @@ public class OptionHandler { * @throws Exception in case of errors */ protected ExitStatus run(OptionSet options) throws Exception { - if (this.closure != null) { - Object result = this.closure.call(options); - if (result instanceof ExitStatus) { - return (ExitStatus) result; - } - if (result instanceof Boolean) { - return (Boolean) result ? ExitStatus.OK : ExitStatus.ERROR; - } - if (result instanceof Integer) { - return new ExitStatus((Integer) result, "Finished"); - } - } return ExitStatus.OK; }