class XargsCommand extends AbstractCommand<XargsArguments>
xargs
command.Modifier | Constructor and Description |
---|---|
|
XargsCommand(XargsArguments arguments) |
protected |
XargsCommand(XargsArguments arguments,
Command<?> invokedCommand) |
Modifier and Type | Method and Description |
---|---|
LineProcessor |
execute(ExecutionContext context,
LineProcessor output)
Executes this command and returns a
LineProcessor object. |
protected Command<?> |
getInvokedCommand() |
Command<?> |
join(Command<?> next)
Returns a new command representing the combination of
this
command with next . |
String |
toString()
Returns a string representation of the command instance including the
argument and option values defined for the command.
|
getArguments, getName
public XargsCommand(XargsArguments arguments)
protected XargsCommand(XargsArguments arguments, Command<?> invokedCommand)
protected Command<?> getInvokedCommand()
public Command<?> join(Command<?> next)
Command
this
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<XargsArguments>
join
in class AbstractCommand<XargsArguments>
next
- the next command to join to this commandthis
command joined to next
public LineProcessor execute(ExecutionContext context, LineProcessor output)
Command
LineProcessor
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 topublic String toString()
Command
toString
in interface Command<XargsArguments>
toString
in class AbstractCommand<XargsArguments>
Copyright © 2024. All rights reserved.