command()and end with
runmethod tells the DSL that you are finished chaining methods and that the command should be executed. Here is the simplest possible example:
versioncommand and the output will be flushed to the console.
CommandDSLclass and returns it. It accepts a single parameter called
namewhich 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.
>>) by chaining the
overwrite()methods. These are mutually exclusive.
pipemethod. This method expects to receive another
CommandDSLinstance. 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.
runmethod. This executes the command. By default, the output will be sent to the console, however you can capture it by specifying
trueand the command will be echoed out prior to execution. The echoed text is not part of what gets returned or piped.
pipedparameter to the