CommandExecutor
enum CommandExecutor
Types of supported command executors.
-
Not execute the command, only prints string:
Executed: <
to standard output. Returned> CommandRunResult
contains defined parameters with this enum.Declaration
Swift
case dummy(status: Int = 0, stdout: String = "", stderr: String = "")
Parameters
status
The command exit status.
stdout
The command standard output.
stderr
The command error output.
-
Execute command and consume all outputs. This outputs can be later read from
CommandRunResult.stdout
andCommandRunResult.stderr
. This executor is suitable for non-interactive, short running commands, likels
,echo
etc.Declaration
Swift
case `default`
-
Execute command with redirected standard/error outputs to system standard outputs. This executor can handle user’s inputs from system standard input. The executor returns actual exit status of executed command but
stdout
andstderr
ofCommandRunResult
will be always empty strings.Declaration
Swift
case interactive