Cmd

:= []

Execute programs in child processes.

new : Str -> Command

Create a new command to execute the given program in a child process.

arg : Command, Str -> Command

Add a single argument to the command.

args : Command, List(Str) -> Command

Add multiple arguments to the command.

env : Command, Str, Str -> Command

Add a single environment variable to the command.

clear_envs : Command -> Command

Clear all environment variables, and prevent inheriting from the parent.

status! : Command => Try(I32, [CmdError(IOErr), ..])

Execute the command, inheriting stdin/stdout/stderr from the parent, and return its exit code.

output! : Command => Output

Execute the command and capture its stdout and stderr.

exec! : Str, List(Str) => Try({  }, [CmdError(IOErr), NonZeroExit(I32), ..])

Execute a program with arguments, inheriting stdin/stdout/stderr. Returns Err(CmdError(...)) on failure, or Err(NonZeroExit(code)) if the program exits non-zero.

Command : {
    program : Str,
    args : List(Str),
    envs : List(EnvVar),
    clear_envs : Bool,
}

Represents a command to be executed in a child process.

EnvVar : {
    key : Str,
    value : Str,
}

An environment variable override for a child process.