Hotfix tab completions for help string varargs commands
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Dieser Commit ist enthalten in:
yoyosource 2023-03-17 21:09:08 +01:00
Ursprung 41b46eb6f5
Commit 595df40e1e

Datei anzeigen

@ -31,6 +31,7 @@ import java.util.function.BiPredicate;
import java.util.function.Function; import java.util.function.Function;
import java.util.function.Supplier; import java.util.function.Supplier;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import java.util.stream.Stream;
public abstract class AbstractSWCommand<T> { public abstract class AbstractSWCommand<T> {
@ -102,7 +103,7 @@ public abstract class AbstractSWCommand<T> {
protected final List<String> tabComplete(T sender, String alias, String[] args) throws IllegalArgumentException { protected final List<String> tabComplete(T sender, String alias, String[] args) throws IllegalArgumentException {
initialize(); initialize();
String string = args[args.length - 1].toLowerCase(); String string = args[args.length - 1].toLowerCase();
return commandList.stream() return Stream.concat(commandList.stream(), helpCommandList.stream())
.filter(s -> !s.noTabComplete) .filter(s -> !s.noTabComplete)
.map(s -> s.tabComplete(sender, args)) .map(s -> s.tabComplete(sender, args))
.filter(Objects::nonNull) .filter(Objects::nonNull)