Package org.jline.shell
Class PipelineBuilder
- java.lang.Object
-
- org.jline.shell.PipelineBuilder
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PipelineBuilderand(java.lang.String command)Adds a conditional AND (&&) to the next command.PipelineBuilderappend(java.nio.file.Path file)Adds an append redirection (>>) to the specified file.PipelineBuilderbackground()Marks this pipeline for background execution.Pipelinebuild()Builds the pipeline.PipelineBuildercombinedRedirect(java.nio.file.Path file)Adds a combined stdout+stderr redirection (&>) to the specified file.PipelineBuilderflip(java.lang.String command)Adds a flip pipe (|;) to the next command.PipelineBuilderinputRedirect(java.nio.file.Path file)Adds an input redirection (<) from the specified file.PipelineBuilderor(java.lang.String command)Adds a conditional OR (||) to the next command.PipelineBuilderpipe(java.lang.String command)Adds a pipe (|) to the next command.PipelineBuilderredirect(java.nio.file.Path file)Adds an output redirection (>) to the specified file.PipelineBuildersequence(java.lang.String command)Adds a sequence separator (;) to the next command.PipelineBuilderstderrRedirect(java.nio.file.Path file)Adds a stderr redirection (2>) to the specified file.
-
-
-
Method Detail
-
pipe
public PipelineBuilder pipe(java.lang.String command)
Adds a pipe (|) to the next command.- Parameters:
command- the next command to pipe to- Returns:
- this builder
-
flip
public PipelineBuilder flip(java.lang.String command)
Adds a flip pipe (|;) to the next command. The output of the previous command is appended as an argument to the next.- Parameters:
command- the next command- Returns:
- this builder
-
and
public PipelineBuilder and(java.lang.String command)
Adds a conditional AND (&&) to the next command. The next command executes only if the previous succeeded.- Parameters:
command- the next command- Returns:
- this builder
-
or
public PipelineBuilder or(java.lang.String command)
Adds a conditional OR (||) to the next command. The next command executes only if the previous failed.- Parameters:
command- the next command- Returns:
- this builder
-
sequence
public PipelineBuilder sequence(java.lang.String command)
Adds a sequence separator (;) to the next command. The next command executes unconditionally after the previous one.- Parameters:
command- the next command- Returns:
- this builder
-
redirect
public PipelineBuilder redirect(java.nio.file.Path file)
Adds an output redirection (>) to the specified file.- Parameters:
file- the file to redirect output to- Returns:
- this builder
-
append
public PipelineBuilder append(java.nio.file.Path file)
Adds an append redirection (>>) to the specified file.- Parameters:
file- the file to append output to- Returns:
- this builder
-
inputRedirect
public PipelineBuilder inputRedirect(java.nio.file.Path file)
Adds an input redirection (<) from the specified file.- Parameters:
file- the file to read input from- Returns:
- this builder
-
stderrRedirect
public PipelineBuilder stderrRedirect(java.nio.file.Path file)
Adds a stderr redirection (2>) to the specified file.- Parameters:
file- the file to redirect stderr to- Returns:
- this builder
-
combinedRedirect
public PipelineBuilder combinedRedirect(java.nio.file.Path file)
Adds a combined stdout+stderr redirection (&>) to the specified file.- Parameters:
file- the file to redirect both streams to- Returns:
- this builder
-
background
public PipelineBuilder background()
Marks this pipeline for background execution.- Returns:
- this builder
-
build
public Pipeline build()
Builds the pipeline.- Returns:
- the constructed pipeline
-
-