Fix #376 Check not to show alternatives for base command

- Fix wrong assumption in HelpCommand that the incoming arguments size always corresponds to the label count of the mapped command
This commit is contained in:
ljacqu
2015-12-24 15:46:48 +01:00
parent 3b33781b0b
commit 418fbabcc8
2 changed files with 3 additions and 2 deletions
@@ -43,8 +43,9 @@ public class HelpCommand extends ExecutableCommand {
}
}
int mappedCommandLevel = foundCommandResult.getCommandDescription().getLabelCount();
PermissionsManager permissionsManager = Wrapper.getInstance().getAuthMe().getPermissionsManager();
List<String> lines = arguments.size() == 1
List<String> lines = (mappedCommandLevel == 1)
? HelpProvider.printHelp(foundCommandResult, HelpProvider.SHOW_CHILDREN)
: HelpProvider.printHelp(foundCommandResult, sender, permissionsManager, HelpProvider.ALL_OPTIONS);
for (String line : lines) {