lines function

Stream<String> lines(
  1. String executableAndArgs, {
  2. Iterable<String>? args,
  3. String? name,
  4. String? workingDirectory,
  5. Map<String, String>? environment,
  6. bool includeParentEnvironment = true,
  7. bool runInShell = false,
})

Runs an executable and returns a stream of lines it prints to stdout.

The returned stream emits a ScriptException if the executable returns a non-zero exit code (unlike Script.stdout).

The executableAndArgs and args arguments are parsed as described in the README. The name is a human-readable identifier for this script that's used in debugging and error reporting, and defaults to the executable name. All other arguments are forwarded to Process.start.

See also Script.lines.

Implementation

Stream<String> lines(String executableAndArgs,
        {Iterable<String>? args,
        String? name,
        String? workingDirectory,
        Map<String, String>? environment,
        bool includeParentEnvironment = true,
        bool runInShell = false}) =>
    Script(executableAndArgs,
            args: args,
            name: name,
            workingDirectory: workingDirectory,
            environment: environment,
            includeParentEnvironment: includeParentEnvironment,
            runInShell: runInShell)
        .lines;