Class OptionParsingCommand

java.lang.Object
org.springframework.boot.cli.command.AbstractCommand
org.springframework.boot.cli.command.OptionParsingCommand
All Implemented Interfaces:
Command
Direct Known Subclasses:
EncodePasswordCommand, GrabCommand, InitCommand, InstallCommand, JarCommand, RunCommand, UninstallCommand, WarCommand

public abstract class OptionParsingCommand extends AbstractCommand
Base class for a Command that parse options using an OptionHandler.
Since:
1.0.0
Author:
Phillip Webb, Dave Syer
See Also:
  • Constructor Details

  • Method Details

    • getHelp

      public String getHelp()
      Description copied from interface: Command
      Gets full help text for the command, e.g. a longer description and one line per option.
      Specified by:
      getHelp in interface Command
      Overrides:
      getHelp in class AbstractCommand
      Returns:
      the command's help text
    • getOptionsHelp

      public Collection<OptionHelp> getOptionsHelp()
      Description copied from interface: Command
      Returns help for each supported option.
      Specified by:
      getOptionsHelp in interface Command
      Overrides:
      getOptionsHelp in class AbstractCommand
      Returns:
      help for each of the command's options
    • run

      public final ExitStatus run(String... args) throws Exception
      Description copied from interface: Command
      Run the command.
      Parameters:
      args - command arguments (this will not include the command itself)
      Returns:
      the outcome of the command
      Throws:
      Exception - if the command fails
    • getHandler

      protected OptionHandler getHandler()