mirror of
https://github.com/AuthMe/AuthMeReloaded.git
synced 2024-12-25 18:17:34 +01:00
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:
parent
3b33781b0b
commit
418fbabcc8
@ -43,8 +43,9 @@ public class HelpCommand extends ExecutableCommand {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int mappedCommandLevel = foundCommandResult.getCommandDescription().getLabelCount();
|
||||||
PermissionsManager permissionsManager = Wrapper.getInstance().getAuthMe().getPermissionsManager();
|
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, HelpProvider.SHOW_CHILDREN)
|
||||||
: HelpProvider.printHelp(foundCommandResult, sender, permissionsManager, HelpProvider.ALL_OPTIONS);
|
: HelpProvider.printHelp(foundCommandResult, sender, permissionsManager, HelpProvider.ALL_OPTIONS);
|
||||||
for (String line : lines) {
|
for (String line : lines) {
|
||||||
|
@ -112,7 +112,7 @@ public final class HelpProvider {
|
|||||||
|
|
||||||
private static void printAlternatives(CommandDescription command, List<String> correctLabels, List<String> lines) {
|
private static void printAlternatives(CommandDescription command, List<String> correctLabels, List<String> lines) {
|
||||||
// TODO ljacqu 20151219: Need to show alternatives for base labels too? E.g. /r for /register
|
// TODO ljacqu 20151219: Need to show alternatives for base labels too? E.g. /r for /register
|
||||||
if (command.getLabels().size() <= 1) {
|
if (command.getLabels().size() <= 1 || correctLabels.size() <= 1) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user