Fix command routing for forwarding commands

completions still funky, but least get execution working
This commit is contained in:
Aikar
2019-02-25 22:46:48 -05:00
parent 16ece3d102
commit 6a7766e35d
2 changed files with 2 additions and 5 deletions
@@ -138,10 +138,6 @@ class CommandRouter {
this(cmd, search.args, search.subcommand, search.commandLabel);
}
CommandRouteResult(CommandRouteResult result, String[] args) {
this(result.cmd, args, result.subcommand, result.commandLabel);
}
CommandRouteResult(RegisteredCommand cmd, String[] args, String subcommand, String commandLabel) {
this.cmd = cmd;
this.args = args;
@@ -40,6 +40,7 @@ public class ForwardingCommand extends BaseCommand {
this.command = baseCommand;
this.baseArgs = baseArgs;
this.manager = baseCommand.manager;
this.subCommands.put(DEFAULT, regCommand);
}
@Override
@@ -79,7 +80,7 @@ public class ForwardingCommand extends BaseCommand {
@Override
public void execute(CommandIssuer issuer, CommandRouter.CommandRouteResult result) {
result = new CommandRouter.CommandRouteResult(result, ApacheCommonsLangUtil.addAll(baseArgs, result.args));
result = new CommandRouter.CommandRouteResult(regCommand, result.args, ACFUtil.join(baseArgs), result.commandLabel);
command.execute(issuer, result);
}