Class CommandContext

java.lang.Object
com.botbox.bbsh.CommandContext

public class CommandContext
extends java.lang.Object
  • Field Summary

    Fields 
    Modifier and Type Field Description
    java.io.PrintStream err  
    java.io.PrintStream out  
  • Constructor Summary

    Constructors 
    Constructor Description
    CommandContext​(CLIContext ch, java.lang.String commandLine, java.lang.String[] args, int pid, Command command)  
  • Method Summary

    Modifier and Type Method Description
    int executeCommand​(java.lang.String command)  
    void exit​(int exitCode)
    exit needs to be called as soon as the command is completed (or stopped).
    CLI getCLI()  
    CLIContext getCLIContext()  
    java.lang.String getCommandName()  
    Env getEnv()  
    int getPID()  
    boolean hasExited()  
    java.lang.String toString()  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • out

      public java.io.PrintStream out
    • err

      public java.io.PrintStream err
  • Constructor Details

  • Method Details

    • getCLI

      public CLI getCLI()
    • getCLIContext

      public CLIContext getCLIContext()
    • getEnv

      public Env getEnv()
    • getPID

      public int getPID()
    • hasExited

      public boolean hasExited()
    • exit

      public void exit​(int exitCode)
      exit needs to be called as soon as the command is completed (or stopped).
      Parameters:
      exitCode - - the exit code of the command
    • getCommandName

      public java.lang.String getCommandName()
    • executeCommand

      public int executeCommand​(java.lang.String command)
    • toString

      public java.lang.String toString()
      Overrides:
      toString in class java.lang.Object