Class CommandInput

java.lang.Object
org.jline.console.CommandInput

public class CommandInput extends Object
Encapsulates the input and output streams for a command execution. This class provides access to the command name, arguments, terminal, and I/O streams needed for command execution in the console environment.
  • Constructor Details

    • CommandInput

      public CommandInput(String command, Object[] xargs, CommandRegistry.CommandSession session)
      Creates a new CommandInput with the specified command, arguments, and session.
      Parameters:
      command - the command name
      xargs - the command arguments as objects
      session - the command session containing terminal and I/O streams
    • CommandInput

      public CommandInput(String command, Object[] args, org.jline.terminal.Terminal terminal, InputStream in, PrintStream out, PrintStream err)
      Creates a new CommandInput with the specified command, arguments, terminal, and I/O streams.
      Parameters:
      command - the command name
      args - the command arguments as objects
      terminal - the terminal instance
      in - the input stream
      out - the output stream
      err - the error stream
  • Method Details

    • command

      public String command()
      Returns the command name.
      Returns:
      the command name
    • args

      public String[] args()
      Returns the command arguments as strings.
      Returns:
      the command arguments as strings
    • xargs

      public Object[] xargs()
      Returns the original command arguments as objects.
      Returns:
      the command arguments as objects
    • terminal

      public org.jline.terminal.Terminal terminal()
      Returns the terminal instance for this command.
      Returns:
      the terminal instance
    • in

      public InputStream in()
      Returns the input stream for this command.
      Returns:
      the input stream
    • out

      public PrintStream out()
      Returns the output stream for this command.
      Returns:
      the output stream
    • err

      public PrintStream err()
      Returns the error stream for this command.
      Returns:
      the error stream
    • session

      Creates and returns a new CommandSession using this command's terminal and I/O streams.
      Returns:
      a new command session