contentOrDefault

protected fun <R> CmdUtils.Var.Result<R>.contentOrDefault(default: R): R

Returns the content of this result (stdout, stderr, or exitCode); Otherwise returns a default value generated by default.

The result is memoized such that the necessary output parsing only happen once lazily, and multiple accesses to the same result of a variable would not incur repeated parsing.

Parameters

default

default value to use when the result cannot be read.