Package org.jline.console
Class CommandInput
java.lang.Object
org.jline.console.CommandInput
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 Summary
ConstructorsConstructorDescriptionCommandInput(String command, Object[] xargs, CommandRegistry.CommandSession session) Creates a new CommandInput with the specified command, arguments, and session.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. -
Method Summary
Modifier and TypeMethodDescriptionString[]args()Returns the command arguments as strings.command()Returns the command name.err()Returns the error stream for this command.in()Returns the input stream for this command.out()Returns the output stream for this command.session()Creates and returns a new CommandSession using this command's terminal and I/O streams.org.jline.terminal.Terminalterminal()Returns the terminal instance for this command.Object[]xargs()Returns the original command arguments as objects.
-
Constructor Details
-
CommandInput
Creates a new CommandInput with the specified command, arguments, and session.- Parameters:
command- the command namexargs- the command arguments as objectssession- 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 nameargs- the command arguments as objectsterminal- the terminal instancein- the input streamout- the output streamerr- the error stream
-
-
Method Details
-
command
-
args
Returns the command arguments as strings.- Returns:
- the command arguments as strings
-
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
-
out
-
err
-
session
Creates and returns a new CommandSession using this command's terminal and I/O streams.- Returns:
- a new command session
-