ShellOptions constructor
ShellOptions({
- bool throwOnError = true,
- String? workingDirectory,
- Map<
String, String> ? environment, - bool includeParentEnvironment = true,
- bool? runInShell,
- Encoding? stdoutEncoding,
- Encoding? stderrEncoding,
- Stream<
List< ? stdin,int> > - StreamSink<
List< ? stdout,int> > - StreamSink<
List< ? stderr,int> > - bool verbose = true,
- bool? commandVerbose,
- bool? commentVerbose,
- bool? noStdoutResult,
- bool? noStderrResult,
throwOnError
means that if an exit code is not 0, it will throw an error
Unless specified runInShell
will be false. However on windows, it will
default to true for non .exe files
if verbose
is not false or commentVerbose
is true, it will display the
comments as well.
If noStdoutResult
is true, stdout will be null in the ProcessResult result
of the run command (runSync will still contain it).
If noStderrResult
is true, stderr will be null in the ProcessResult result
of the run command (runSync will still contain it).
Implementation
ShellOptions({
bool throwOnError = true,
String? workingDirectory,
Map<String, String>? environment,
bool includeParentEnvironment = true,
bool? runInShell,
Encoding? stdoutEncoding,
Encoding? stderrEncoding,
Stream<List<int>>? stdin,
StreamSink<List<int>>? stdout,
StreamSink<List<int>>? stderr,
bool verbose = true,
// Default to true
bool? commandVerbose,
// Default to false
bool? commentVerbose,
// Default to false
bool? noStdoutResult,
// Default to false
bool? noStderrResult,
}) : _throwOnError = throwOnError,
_workingDirectory = workingDirectory,
_runInShell = runInShell,
_stdoutEncoding = stdoutEncoding,
_stderrEncoding = stderrEncoding,
_stdin = stdin,
_stdout = stdout,
_stderr = stderr,
_verbose = verbose,
_commandVerbose = commandVerbose ?? verbose,
_commentVerbose = commentVerbose ?? false,
_noStderrResult = noStderrResult,
_noStdoutResult = noStdoutResult {
_environment = ShellEnvironment.full(
environment: environment,
includeParentEnvironment: includeParentEnvironment);
}