diff --git a/docs/acf-core/co/aikar/commands/CommandCompletions.SyncCompletionRequired.html b/docs/acf-core/co/aikar/commands/CommandCompletions.SyncCompletionRequired.html index d8a92788..a5b76219 100644 --- a/docs/acf-core/co/aikar/commands/CommandCompletions.SyncCompletionRequired.html +++ b/docs/acf-core/co/aikar/commands/CommandCompletions.SyncCompletionRequired.html @@ -99,6 +99,9 @@
public static class CommandCompletions.SyncCompletionRequired -extends Exception+
public static class CommandCompletions.SyncCompletionRequired +extends RuntimeException
List<String>tabComplete(CommandIssuer issuer,
+tabComplete(CommandIssuer issuer,
String alias,
- String[] args)
-Gets tab completed data from the given command from the user.
+ String[] args,
+ boolean isAsync)
+Gets the tab complete suggestions from a given command.
@@ -157,7 +158,7 @@ extends BaseCommand
-canExecute, doHelp, doHelp, getCommandHelp, getContextFlags, getCurrentCommandIssuer, getCurrentCommandManager, getDefaultRegisteredCommand, getExceptionHandler, getExecCommandLabel, getExecSubcommand, getName, getOrigArgs, getRequiredPermissions, hasPermission, help, help, requiresPermission, setContextFlags, setExceptionHandler, showCommandHelp, showSyntax, tabComplete
+canExecute, doHelp, doHelp, getCommandHelp, getContextFlags, getCurrentCommandIssuer, getCurrentCommandManager, getDefaultRegisteredCommand, getExceptionHandler, getExecCommandLabel, getExecSubcommand, getName, getOrigArgs, getRequiredPermissions, hasPermission, help, help, requiresPermission, setContextFlags, setExceptionHandler, showCommandHelp, showSyntax, tabComplete
-
@@ -193,7 +194,7 @@ extends
+
@@ -201,19 +202,22 @@ extends List<String> tabComplete(CommandIssuer issuer,
String alias,
- String[] args)
+ String[] args,
+ boolean isAsync)
throws IllegalArgumentException
-Description copied from class: BaseCommand
-Gets tab completed data from the given command from the user.
+Description copied from class: BaseCommand
+Gets the tab complete suggestions from a given command. This will automatically find anything
+ which is valid for the specified command through the command's implementation.
- Overrides:
-tabComplete in class BaseCommand
+tabComplete in class BaseCommand
- Parameters:
-issuer - The user who executed the tabcomplete.
-alias - The label which is being used by the user.
-args - The arguments the user has typed so far.
+issuer - The issuer of the command.
+alias - The command name as entered by the user instead of the ACF registered name.
+args - All arguments entered by the user.
+isAsync - Whether this is run off of the main thread.
- Returns:
-- All possibilities in the tab complete.
+- The possibilities to tab complete in no particular order.
- Throws:
IllegalArgumentException
diff --git a/docs/acf-core/co/aikar/commands/RootCommand.html b/docs/acf-core/co/aikar/commands/RootCommand.html
index 18d9998a..4e513d14 100644
--- a/docs/acf-core/co/aikar/commands/RootCommand.html
+++ b/docs/acf-core/co/aikar/commands/RootCommand.html
@@ -269,7 +269,7 @@ var activeTableTab = "activeTableTab";
-
execute
-default BaseCommand execute(CommandIssuer sender,
+default BaseCommand execute(CommandIssuer sender,
String commandLabel,
String[] args)
@@ -280,7 +280,7 @@ var activeTableTab = "activeTableTab";
-
getBaseCommand
-default BaseCommand getBaseCommand(String[] args)
+default BaseCommand getBaseCommand(String[] args)
@@ -289,7 +289,7 @@ var activeTableTab = "activeTableTab";
-
getTabCompletions
-default List<String> getTabCompletions(CommandIssuer sender,
+default List<String> getTabCompletions(CommandIssuer sender,
String alias,
String[] args)
@@ -300,7 +300,7 @@ var activeTableTab = "activeTableTab";
-
getTabCompletions
-default List<String> getTabCompletions(CommandIssuer sender,
+default List<String> getTabCompletions(CommandIssuer sender,
String alias,
String[] args,
boolean commandsOnly)
@@ -312,7 +312,7 @@ var activeTableTab = "activeTableTab";
-
getTabCompletions
-default List<String> getTabCompletions(CommandIssuer sender,
+default List<String> getTabCompletions(CommandIssuer sender,
String alias,
String[] args,
boolean commandsOnly,
@@ -325,7 +325,7 @@ var activeTableTab = "activeTableTab";
-
getDefaultRegisteredCommand
-default RegisteredCommand getDefaultRegisteredCommand()
+default RegisteredCommand getDefaultRegisteredCommand()
@@ -334,7 +334,7 @@ var activeTableTab = "activeTableTab";
-
getDefCommand
-default BaseCommand getDefCommand()
+default BaseCommand getDefCommand()
@@ -343,7 +343,7 @@ var activeTableTab = "activeTableTab";
-
getDescription
-default String getDescription()
+default String getDescription()
@@ -352,7 +352,7 @@ var activeTableTab = "activeTableTab";
diff --git a/docs/acf-core/co/aikar/commands/class-use/CommandIssuer.html b/docs/acf-core/co/aikar/commands/class-use/CommandIssuer.html
index 94a1f76f..f99f327d 100644
--- a/docs/acf-core/co/aikar/commands/class-use/CommandIssuer.html
+++ b/docs/acf-core/co/aikar/commands/class-use/CommandIssuer.html
@@ -442,12 +442,6 @@
List<String>
-ForwardingCommand.tabComplete(CommandIssuer issuer,
- String alias,
- String[] args)
-
-
-List<String>
BaseCommand.tabComplete(CommandIssuer issuer,
String commandLabel,
String[] args,
@@ -455,6 +449,13 @@
Gets the tab complete suggestions from a given command.
+
+List<String>
+ForwardingCommand.tabComplete(CommandIssuer issuer,
+ String alias,
+ String[] args,
+ boolean isAsync)
+
diff --git a/docs/acf-core/co/aikar/commands/package-tree.html b/docs/acf-core/co/aikar/commands/package-tree.html
index 6a9b9156..0ac75c85 100644
--- a/docs/acf-core/co/aikar/commands/package-tree.html
+++ b/docs/acf-core/co/aikar/commands/package-tree.html
@@ -107,7 +107,6 @@
- java.lang.Exception
-- co.aikar.commands.CommandCompletions.SyncCompletionRequired
- co.aikar.commands.InvalidCommandArgument
- co.aikar.commands.ConditionFailedException
@@ -116,6 +115,7 @@
- java.lang.RuntimeException
+- co.aikar.commands.CommandCompletions.SyncCompletionRequired
- co.aikar.commands.InvalidCommandContextException
- co.aikar.commands.UnresolvedDependencyException
diff --git a/docs/acf-core/index-all.html b/docs/acf-core/index-all.html
index 93d2b6fc..12a697bd 100644
--- a/docs/acf-core/index-all.html
+++ b/docs/acf-core/index-all.html
@@ -1839,7 +1839,7 @@
-
Gets the tab complete suggestions from a given command.
-- tabComplete(CommandIssuer, String, String[]) - Method in class co.aikar.commands.ForwardingCommand
+- tabComplete(CommandIssuer, String, String[], boolean) - Method in class co.aikar.commands.ForwardingCommand
-
- THAI - Static variable in class co.aikar.commands.Locales
-
diff --git a/docs/acf-core/overview-tree.html b/docs/acf-core/overview-tree.html
index 20019591..f74f6e63 100644
--- a/docs/acf-core/overview-tree.html
+++ b/docs/acf-core/overview-tree.html
@@ -114,7 +114,6 @@
- java.lang.Exception
-- co.aikar.commands.CommandCompletions.SyncCompletionRequired
- co.aikar.commands.InvalidCommandArgument
- co.aikar.commands.ConditionFailedException
@@ -123,6 +122,7 @@
- java.lang.RuntimeException
+- co.aikar.commands.CommandCompletions.SyncCompletionRequired
- co.aikar.commands.InvalidCommandContextException
- co.aikar.commands.UnresolvedDependencyException
diff --git a/docs/acf-core/serialized-form.html b/docs/acf-core/serialized-form.html
index 6545d53f..da21902c 100644
--- a/docs/acf-core/serialized-form.html
+++ b/docs/acf-core/serialized-form.html
@@ -79,7 +79,7 @@
-
-
Class co.aikar.commands.CommandCompletions.SyncCompletionRequired extends Exception implements Serializable
+Class co.aikar.commands.CommandCompletions.SyncCompletionRequired extends RuntimeException implements Serializable
-
diff --git a/docs/acf-core/src-html/co/aikar/commands/CommandCompletions.AsyncCommandCompletionHandler.html b/docs/acf-core/src-html/co/aikar/commands/CommandCompletions.AsyncCommandCompletionHandler.html
index 84e7d432..772b1b02 100644
--- a/docs/acf-core/src-html/co/aikar/commands/CommandCompletions.AsyncCommandCompletionHandler.html
+++ b/docs/acf-core/src-html/co/aikar/commands/CommandCompletions.AsyncCommandCompletionHandler.html
@@ -241,9 +241,11 @@
233 Collection<String> getCompletions(C context) throws InvalidCommandArgument;
234 }
235 public interface AsyncCommandCompletionHandler <C extends CommandCompletionContext> extends CommandCompletionHandler <C> {}
-236 public static class SyncCompletionRequired extends Exception {}
-237
-238}
+236
+237 public static class SyncCompletionRequired extends RuntimeException {
+238 }
+239
+240}
diff --git a/docs/acf-core/src-html/co/aikar/commands/CommandCompletions.CommandCompletionHandler.html b/docs/acf-core/src-html/co/aikar/commands/CommandCompletions.CommandCompletionHandler.html
index 84e7d432..772b1b02 100644
--- a/docs/acf-core/src-html/co/aikar/commands/CommandCompletions.CommandCompletionHandler.html
+++ b/docs/acf-core/src-html/co/aikar/commands/CommandCompletions.CommandCompletionHandler.html
@@ -241,9 +241,11 @@
233 Collection<String> getCompletions(C context) throws InvalidCommandArgument;
234 }
235 public interface AsyncCommandCompletionHandler <C extends CommandCompletionContext> extends CommandCompletionHandler <C> {}
-236 public static class SyncCompletionRequired extends Exception {}
-237
-238}
+236
+237 public static class SyncCompletionRequired extends RuntimeException {
+238 }
+239
+240}
diff --git a/docs/acf-core/src-html/co/aikar/commands/CommandCompletions.SyncCompletionRequired.html b/docs/acf-core/src-html/co/aikar/commands/CommandCompletions.SyncCompletionRequired.html
index 84e7d432..772b1b02 100644
--- a/docs/acf-core/src-html/co/aikar/commands/CommandCompletions.SyncCompletionRequired.html
+++ b/docs/acf-core/src-html/co/aikar/commands/CommandCompletions.SyncCompletionRequired.html
@@ -241,9 +241,11 @@
233 Collection<String> getCompletions(C context) throws InvalidCommandArgument;
234 }
235 public interface AsyncCommandCompletionHandler <C extends CommandCompletionContext> extends CommandCompletionHandler <C> {}
-236 public static class SyncCompletionRequired extends Exception {}
-237
-238}
+236
+237 public static class SyncCompletionRequired extends RuntimeException {
+238 }
+239
+240}
diff --git a/docs/acf-core/src-html/co/aikar/commands/CommandCompletions.html b/docs/acf-core/src-html/co/aikar/commands/CommandCompletions.html
index 84e7d432..772b1b02 100644
--- a/docs/acf-core/src-html/co/aikar/commands/CommandCompletions.html
+++ b/docs/acf-core/src-html/co/aikar/commands/CommandCompletions.html
@@ -241,9 +241,11 @@
233 Collection<String> getCompletions(C context) throws InvalidCommandArgument;
234 }
235 public interface AsyncCommandCompletionHandler <C extends CommandCompletionContext> extends CommandCompletionHandler <C> {}
-236 public static class SyncCompletionRequired extends Exception {}
-237
-238}
+236
+237 public static class SyncCompletionRequired extends RuntimeException {
+238 }
+239
+240}
diff --git a/docs/acf-core/src-html/co/aikar/commands/ForwardingCommand.html b/docs/acf-core/src-html/co/aikar/commands/ForwardingCommand.html
index 747a5a7f..01447b68 100644
--- a/docs/acf-core/src-html/co/aikar/commands/ForwardingCommand.html
+++ b/docs/acf-core/src-html/co/aikar/commands/ForwardingCommand.html
@@ -52,7 +52,7 @@
044 }
045
046 @Override
-047 public List<String> tabComplete(CommandIssuer issuer, String alias, String[] args) throws IllegalArgumentException {
+047 public List<String> tabComplete(CommandIssuer issuer, String alias, String[] args, boolean isAsync) throws IllegalArgumentException {
048 return command.tabComplete(issuer, alias, ApacheCommonsLangUtil.addAll(baseArgs, args));
049 }
050
diff --git a/docs/acf-core/src-html/co/aikar/commands/RootCommand.html b/docs/acf-core/src-html/co/aikar/commands/RootCommand.html
index af1517cb..b8a28f29 100644
--- a/docs/acf-core/src-html/co/aikar/commands/RootCommand.html
+++ b/docs/acf-core/src-html/co/aikar/commands/RootCommand.html
@@ -48,104 +48,101 @@
040
041 String getCommandName();
042 default void addChildShared(List<BaseCommand> children, SetMultimap<String, RegisteredCommand> subCommands, BaseCommand command) {
-043 if (command.manager == null) {
-044 command.manager = getManager();
-045 }
-046 command.subCommands.entries().forEach(e -> {
-047 String key = e.getKey();
-048 RegisteredCommand registeredCommand = e.getValue();
-049 if (key.equals(BaseCommand.DEFAULT) || key.equals(BaseCommand.CATCHUNKNOWN)) {
-050 return;
-051 }
-052 Set<RegisteredCommand> registered = subCommands.get(key);
-053 if (!registered.isEmpty()) {
-054 BaseCommand prevBase = registered.iterator().next().scope;
-055 if (prevBase != registeredCommand.scope) {
-056 this.getManager().log(LogLevel.ERROR, "ACF Error: " + command.getName() + " registered subcommand " + key + " for root command " + getCommandName() + " - but it is already defined in " + prevBase.getName());
-057 this.getManager().log(LogLevel.ERROR, "2 subcommands of the same prefix may not be spread over 2 different classes. Ignoring this.");
-058 return;
-059 }
-060 }
-061 subCommands.put(key, registeredCommand);
-062 });
+043 command.subCommands.entries().forEach(e -> {
+044 String key = e.getKey();
+045 RegisteredCommand registeredCommand = e.getValue();
+046 if (key.equals(BaseCommand.DEFAULT) || key.equals(BaseCommand.CATCHUNKNOWN)) {
+047 return;
+048 }
+049 Set<RegisteredCommand> registered = subCommands.get(key);
+050 if (!registered.isEmpty()) {
+051 BaseCommand prevBase = registered.iterator().next().scope;
+052 if (prevBase != registeredCommand.scope) {
+053 this.getManager().log(LogLevel.ERROR, "ACF Error: " + command.getName() + " registered subcommand " + key + " for root command " + getCommandName() + " - but it is already defined in " + prevBase.getName());
+054 this.getManager().log(LogLevel.ERROR, "2 subcommands of the same prefix may not be spread over 2 different classes. Ignoring this.");
+055 return;
+056 }
+057 }
+058 subCommands.put(key, registeredCommand);
+059 });
+060
+061 children.add(command);
+062 }
063
-064 children.add(command);
-065 }
+064 default BaseCommand execute(CommandIssuer sender, String commandLabel, String[] args) {
+065 BaseCommand command = getBaseCommand(args);
066
-067 default BaseCommand execute(CommandIssuer sender, String commandLabel, String[] args) {
-068 BaseCommand command = getBaseCommand(args);
-069
-070 command.execute(sender, commandLabel, args);
-071 return command;
-072 }
-073
-074 default BaseCommand getBaseCommand(String[] args) {
-075 BaseCommand command = getDefCommand();
-076 for (int i = args.length; i >= 0; i--) {
-077 String checkSub = ApacheCommonsLangUtil.join(args, " ", 0, i).toLowerCase();
-078 Set<RegisteredCommand> registeredCommands = getSubCommands().get(checkSub);
-079 if (!registeredCommands.isEmpty()) {
-080 command = registeredCommands.iterator().next().scope;
-081 break;
-082 }
-083 }
-084 return command;
-085 }
-086
-087 default List<String> getTabCompletions(CommandIssuer sender, String alias, String[] args) {
-088 return getTabCompletions(sender, alias, args, false);
-089 }
-090
-091 default List<String> getTabCompletions(CommandIssuer sender, String alias, String[] args, boolean commandsOnly) {
-092 return getTabCompletions(sender, alias, args, commandsOnly, false);
-093 }
-094
-095 default List<String> getTabCompletions(CommandIssuer sender, String alias, String[] args, boolean commandsOnly, boolean isAsync) {
-096 Set<String> completions = new HashSet<>();
-097 getChildren().forEach(child -> {
-098 if (!commandsOnly) {
-099 completions.addAll(child.tabComplete(sender, alias, args, isAsync));
-100 }
-101 completions.addAll(child.getCommandsForCompletion(sender, args));
-102 });
-103 return new ArrayList<>(completions);
-104 }
-105
-106
-107 default RegisteredCommand getDefaultRegisteredCommand() {
-108 BaseCommand defCommand = this.getDefCommand();
-109 if (defCommand != null) {
-110 return defCommand.getDefaultRegisteredCommand();
-111 }
-112 return null;
-113 }
-114
-115 default BaseCommand getDefCommand(){
-116 return null;
-117 }
-118
-119
-120 default String getDescription() {
-121 final RegisteredCommand cmd = this.getDefaultRegisteredCommand();
-122 if (cmd != null) {
-123 return cmd.getHelpText();
-124 }
-125 BaseCommand defCommand = getDefCommand();
-126 if (defCommand != null && defCommand.description != null) {
-127 return defCommand.description;
-128 }
-129 return "";
-130 }
-131
-132
-133 default String getUsage() {
-134 final RegisteredCommand cmd = this.getDefaultRegisteredCommand();
-135 if (cmd != null) {
-136 return cmd.syntaxText != null ? cmd.syntaxText : "";
-137 }
-138 return "";
-139 }
-140}
+067 command.execute(sender, commandLabel, args);
+068 return command;
+069 }
+070
+071 default BaseCommand getBaseCommand(String[] args) {
+072 BaseCommand command = getDefCommand();
+073 for (int i = args.length; i >= 0; i--) {
+074 String checkSub = ApacheCommonsLangUtil.join(args, " ", 0, i).toLowerCase();
+075 Set<RegisteredCommand> registeredCommands = getSubCommands().get(checkSub);
+076 if (!registeredCommands.isEmpty()) {
+077 command = registeredCommands.iterator().next().scope;
+078 break;
+079 }
+080 }
+081 return command;
+082 }
+083
+084 default List<String> getTabCompletions(CommandIssuer sender, String alias, String[] args) {
+085 return getTabCompletions(sender, alias, args, false);
+086 }
+087
+088 default List<String> getTabCompletions(CommandIssuer sender, String alias, String[] args, boolean commandsOnly) {
+089 return getTabCompletions(sender, alias, args, commandsOnly, false);
+090 }
+091
+092 default List<String> getTabCompletions(CommandIssuer sender, String alias, String[] args, boolean commandsOnly, boolean isAsync) {
+093 Set<String> completions = new HashSet<>();
+094 getChildren().forEach(child -> {
+095 if (!commandsOnly) {
+096 completions.addAll(child.tabComplete(sender, alias, args, isAsync));
+097 }
+098 completions.addAll(child.getCommandsForCompletion(sender, args));
+099 });
+100 return new ArrayList<>(completions);
+101 }
+102
+103
+104 default RegisteredCommand getDefaultRegisteredCommand() {
+105 BaseCommand defCommand = this.getDefCommand();
+106 if (defCommand != null) {
+107 return defCommand.getDefaultRegisteredCommand();
+108 }
+109 return null;
+110 }
+111
+112 default BaseCommand getDefCommand(){
+113 return null;
+114 }
+115
+116
+117 default String getDescription() {
+118 final RegisteredCommand cmd = this.getDefaultRegisteredCommand();
+119 if (cmd != null) {
+120 return cmd.getHelpText();
+121 }
+122 BaseCommand defCommand = getDefCommand();
+123 if (defCommand != null && defCommand.description != null) {
+124 return defCommand.description;
+125 }
+126 return "";
+127 }
+128
+129
+130 default String getUsage() {
+131 final RegisteredCommand cmd = this.getDefaultRegisteredCommand();
+132 if (cmd != null) {
+133 return cmd.syntaxText != null ? cmd.syntaxText : "";
+134 }
+135 return "";
+136 }
+137}