|
|
|
@ -33,6 +33,7 @@ import jline.console.completer.StringsCompleter;
|
|
|
|
|
import org.springframework.boot.cli.command.Command;
|
|
|
|
|
import org.springframework.boot.cli.command.options.OptionHelp;
|
|
|
|
|
import org.springframework.boot.cli.util.Log;
|
|
|
|
|
import org.springframework.util.StringUtils;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* JLine {@link Completer} for Spring Boot {@link Command}s.
|
|
|
|
@ -74,7 +75,7 @@ public class CommandCompleter extends StringsCompleter {
|
|
|
|
|
int completionIndex = super.complete(buffer, cursor, candidates);
|
|
|
|
|
int spaceIndex = buffer.indexOf(' ');
|
|
|
|
|
String commandName = ((spaceIndex != -1) ? buffer.substring(0, spaceIndex) : "");
|
|
|
|
|
if (!"".equals(commandName.trim())) {
|
|
|
|
|
if (StringUtils.hasText(commandName)) {
|
|
|
|
|
for (Command command : this.commands) {
|
|
|
|
|
if (command.getName().equals(commandName)) {
|
|
|
|
|
if (cursor == buffer.length() && buffer.endsWith(" ")) {
|
|
|
|
|