class Shell.CommandOutput


The output of a shell command executed via Shell.command. This class offers access to the stdOut and stdErr of the launched command, with utility methods to wait for the full output or parse the stream incrementally.

Summary

Public constructors

CommandOutput(command: String, shellProcess: ShellProcess)

Public functions

Sequence<String>

Allows incrementally consuming the stderr of the launched command as lines.

T
<T : Any?> stdErrStream(block: InputStream.() -> T)

Allows incrementally consuming the stderr of a single command as an InputStream.

Sequence<String>

Allows incrementally consuming the stdout of the launched command as lines.

T
<T : Any?> stdOutStream(block: InputStream.() -> T)

Allows incrementally consuming the stdout of a single command as an InputStream.

Public properties

String

Awaits the process termination and returns the full stderr of the launched command.

String

Awaits the process termination and returns the full stdout of the launched command.

Public constructors

CommandOutput

Added in 1.0.0-alpha01
CommandOutput(command: String, shellProcess: ShellProcess)

Public functions

stdErrLines

Added in 1.0.0-alpha01
fun stdErrLines(): Sequence<String>

Allows incrementally consuming the stderr of the launched command as lines.

stdErrStream

Added in 1.0.0-alpha01
fun <T : Any?> stdErrStream(block: InputStream.() -> T): T

Allows incrementally consuming the stderr of a single command as an InputStream.

stdOutLines

Added in 1.0.0-alpha01
fun stdOutLines(): Sequence<String>

Allows incrementally consuming the stdout of the launched command as lines.

stdOutStream

Added in 1.0.0-alpha01
fun <T : Any?> stdOutStream(block: InputStream.() -> T): T

Allows incrementally consuming the stdout of a single command as an InputStream.

Public properties

stdErr

Added in 1.0.0-alpha01
val stdErrString

Awaits the process termination and returns the full stderr of the launched command.

stdOut

Added in 1.0.0-alpha01
val stdOutString

Awaits the process termination and returns the full stdout of the launched command.