Class CAShell

java.lang.Object
com.io7m.cardant.shell.internal.CAShell
All Implemented Interfaces:
CAShellType, AutoCloseable

public final class CAShell extends Object implements CAShellType
The basic shell.
  • Constructor Details

    • CAShell

      public CAShell(com.io7m.repetoir.core.RPServiceDirectoryType inServices, org.jline.terminal.Terminal inTerminal, PrintWriter inWriter, Map<String,CAShellCmdType> inCommandsNamed, org.jline.reader.LineReader inReader)
      The basic shell.
      Parameters:
      inServices - The service directory
      inTerminal - The terminal
      inWriter - The writer
      inCommandsNamed - The named commands
      inReader - The line reader
  • Method Details

    • close

      public void close() throws Exception
      Specified by:
      close in interface AutoCloseable
      Throws:
      Exception
    • commands

      public Collection<com.io7m.quarrel.core.QCommandType> commands()
      Specified by:
      commands in interface CAShellType
      Returns:
      The set of commands exposed by the shell
    • run

      public void run()
      Description copied from interface: CAShellType
      Run the shell until the user asks it to exit (or it reaches EOF).
      Specified by:
      run in interface CAShellType
    • exitCode

      public int exitCode()
      Specified by:
      exitCode in interface CAShellType
      Returns:
      The shell exit kind
    • toString

      public String toString()
      Overrides:
      toString in class Object