java.lang.Object
org.springframework.shell.core.command.AbstractCommand
org.springframework.shell.core.command.Script
All Implemented Interfaces:
Command

public class Script extends AbstractCommand
A command that can read and execute other commands from a file.
Author:
Eric Bottard, Janne Valkealahti, Mahmoud Ben Hassine, David Pilar, Ezequiel Primon
  • Constructor Details

  • Method Details

    • getHelp

      public String getHelp()
      Description copied from interface: Command
      Get the help text of the command. It is reported as the DESCRIPTION section of the detailed help message of the command, which is omitted when the text is empty. Unlike Command.getDescription(), which is a one liner shown in the list of available commands, the help text is meant to be a longer explanation of what the command does.
      Specified by:
      getHelp in interface Command
      Overrides:
      getHelp in class AbstractCommand
      Returns:
      the help text of the command, empty when the command does not define one
    • getOptions

      public List<CommandOption> getOptions()
      Description copied from interface: Command
      Get the options of the command.
      Specified by:
      getOptions in interface Command
      Overrides:
      getOptions in class AbstractCommand
      Returns:
      the options of the command
    • doExecute

      public ExitStatus doExecute(CommandContext commandContext) throws Exception
      Specified by:
      doExecute in class AbstractCommand
      Throws:
      Exception
    • setCommandParser

      public void setCommandParser(CommandParser commandParser)
      Set the command parser to use to parse commands in the script.
      Parameters:
      commandParser - the command parser to set