Class HelpCommandBase

java.lang.Object
dev.ua.theroer.magicutils.commands.MagicCommand
dev.ua.theroer.magicutils.commands.HelpCommandBase

public class HelpCommandBase extends MagicCommand
Shared help command implementation for all platforms.
  • Constructor Details

    • HelpCommandBase

      public HelpCommandBase(LoggerCore logger, Supplier<CommandManager<?>> managerSupplier)
      Creates a help command using the default command name.
      Parameters:
      logger - logger core
      managerSupplier - supplier for command manager
    • HelpCommandBase

      public HelpCommandBase(LoggerCore logger, Supplier<CommandManager<?>> managerSupplier, String helpCommand)
      Creates a help command with a custom command name.
      Parameters:
      logger - logger core
      managerSupplier - supplier for command manager
      helpCommand - help command name
  • Method Details

    • execute

      public CommandResult execute(MagicSender sender, String commandName, String subCommand)
      Executes the help command.
      Parameters:
      sender - command sender
      commandName - optional command filter
      subCommand - optional subcommand filter
      Returns:
      command result
    • getCommandSuggestions

      public String[] getCommandSuggestions()
      Returns suggestions for known command names.
      Returns:
      command name suggestions
    • sendLine

      protected void sendLine(MagicSender sender, String line)
      Sends a formatted line to the sender.
      Parameters:
      sender - command sender
      line - line to send