class CdCommand extends AbstractCommand<CdArguments>
cd command.| Constructor and Description |
|---|
CdCommand(CdArguments arguments) |
| Modifier and Type | Method and Description |
|---|---|
LineProcessor |
execute(ExecutionContext context,
LineProcessor output)
Executes this command and returns a
LineProcessor object. |
Command<CdArguments> |
join(Command<?> next)
Returns a new command representing the combination of
this
command with next. |
getArguments, getName, toStringpublic CdCommand(CdArguments arguments)
public Command<CdArguments> join(Command<?> next)
Commandthis
command with next. The returned command executes this
command first and usually joins the output to the next command's
input.
Note that some commands may use a slightly different interpretation of
"joining a command". The xargs command for instance uses its
joined command as target command; the values collected by xargs
on its input stream are passed to the target command as arguments instead
of as input.
join in interface Command<CdArguments>join in class AbstractCommand<CdArguments>next - the next command to join to this commandthis
command joined to nextpublic LineProcessor execute(ExecutionContext context, LineProcessor output)
CommandLineProcessor object. Calling
this method initiates the command execution, but the real processing of
the command takes place when lines are passed to the returned
LineProcessor object. The command execution is terminated by
calling LineProcessor.finish().
The command writes its output to the specified output object.
Depending on the command implementation, the output is written when lines
are passed to the LineProcessor returned by this method, or when
the execution terminates with the finish() call.
context - context object providing access to the current directory,
environment variables and other information useful for the
command during its executionoutput - the output to write toCopyright © 2025. All rights reserved.