command()
and end with .run()
. The run
method tells the DSL that you are finished chaining methods and that the command should be executed. Here is the simplest possible example:version
command and the output will be flushed to the console.CommandDSL
class and returns it. It accepts a single parameter called name
which is the name of the command you wish to run. Type the name exactly as you would in the shell including the namespace, if applicable.--
prior to the value, but it will still work.>
and >>
) by chaining the append()
or overwrite()
methods. These are mutually exclusive.pipe
method. This method expects to receive another CommandDSL
instance. You do not need to call run()
on the nested command. This example is the equivalent to echo "hello\nworld" | grep lo
.pipe()
method. Each piped command will be called in order, receiving the output from the previous one.run
method. This executes the command. By default, the output will be sent to the console, however you can capture it by specifying returnOutput
as true
.echo
parameter to true
and the command will be echoed out prior to execution. The echoed text is not part of what gets returned or piped.piped
parameter to the run
method.