diff --git a/spring-boot-cli/src/main/java/org/springframework/boot/cli/CommandFactory.java b/spring-boot-cli/src/main/java/org/springframework/boot/cli/CommandFactory.java index c5b3a29ffd3..5126c830be3 100644 --- a/spring-boot-cli/src/main/java/org/springframework/boot/cli/CommandFactory.java +++ b/spring-boot-cli/src/main/java/org/springframework/boot/cli/CommandFactory.java @@ -31,6 +31,6 @@ public interface CommandFactory { * Returns the CLI {@link Command}s. * @return The commands */ - Collection getCommands(); + Collection getCommands(SpringCli cli); } diff --git a/spring-boot-cli/src/main/java/org/springframework/boot/cli/SpringCli.java b/spring-boot-cli/src/main/java/org/springframework/boot/cli/SpringCli.java index 5a86d125491..3e3323e87fb 100644 --- a/spring-boot-cli/src/main/java/org/springframework/boot/cli/SpringCli.java +++ b/spring-boot-cli/src/main/java/org/springframework/boot/cli/SpringCli.java @@ -60,7 +60,7 @@ public class SpringCli { private void setCommands(Iterable iterable) { this.commands = new ArrayList(); for (CommandFactory factory : iterable) { - for (Command command : factory.getCommands()) { + for (Command command : factory.getCommands(this)) { this.commands.add(command); } } diff --git a/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/DefaultCommandFactory.java b/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/DefaultCommandFactory.java index ca05222207e..0b453ed43e0 100644 --- a/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/DefaultCommandFactory.java +++ b/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/DefaultCommandFactory.java @@ -22,6 +22,7 @@ import java.util.List; import org.springframework.boot.cli.Command; import org.springframework.boot.cli.CommandFactory; +import org.springframework.boot.cli.SpringCli; /** * Default implementation of {@link CommandFactory}. @@ -35,7 +36,7 @@ public class DefaultCommandFactory implements CommandFactory { new TestCommand(), new GrabCommand()); @Override - public Collection getCommands() { + public Collection getCommands(SpringCli cli) { return DEFAULT_COMMANDS; }