runExecutableArguments function
Future<ProcessResult>
runExecutableArguments(
- String executable,
- List<
String> arguments, { - ShellOptions? options,
- String? workingDirectory,
- Map<
String, String> ? environment, - bool includeParentEnvironment = true,
- bool? runInShell,
- Encoding? stdoutEncoding = systemEncoding,
- Encoding? stderrEncoding = systemEncoding,
- Stream<
List< ? stdin,int> > - StreamSink<
List< ? stdout,int> > - StreamSink<
List< ? stderr,int> > - bool? verbose,
- bool? commandVerbose,
- bool? noStdoutResult,
- bool? noStderrResult,
- ShellOnProcessCallback? onProcess,
- ProcessStartMode? mode,
- bool? throwOnError,
if commandVerbose or verbose is true, display the command.
if verbose is true, stream stdout & stdin
Optional onProcess(process) is called to allow killing the process.
If noStdoutResult is true, the result will not contain the stdout.
If noStderrResult is true, the result will not contain the stderr.
Don't mess-up with the input and output for now here. only use it for kill.
Implementation
Future<ProcessResult> runExecutableArguments(
String executable,
List<String> arguments, {
/// Prefer options, or even better, use a shell...
ShellOptions? options,
// follwing To deprecate
String? workingDirectory,
Map<String, String>? environment,
bool includeParentEnvironment = true,
bool? runInShell,
Encoding? stdoutEncoding = systemEncoding,
Encoding? stderrEncoding = systemEncoding,
Stream<List<int>>? stdin,
StreamSink<List<int>>? stdout,
StreamSink<List<int>>? stderr,
bool? verbose,
bool? commandVerbose,
bool? noStdoutResult,
bool? noStderrResult,
ShellOnProcessCallback? onProcess,
ProcessStartMode? mode,
/// Compat default to false...
bool? throwOnError,
}) async {
throwOnError ??= false;
options ??= ShellOptions(
verbose: verbose ?? false,
commandVerbose: commandVerbose,
stderrEncoding: stderrEncoding,
stdoutEncoding: stdoutEncoding,
workingDirectory: workingDirectory,
stdout: stdout,
stderr: stderr,
stdin: stdin,
environment: environment,
includeParentEnvironment: includeParentEnvironment,
runInShell: runInShell,
mode: mode,
noStderrResult: noStderrResult,
noStdoutResult: noStdoutResult,
throwOnError: throwOnError,
);
var shell = Shell(options: options);
var result = await shell.runExecutableArguments(
executable,
arguments,
onProcess: onProcess,
);
return result;
}