Processes
The stdlib provides three process-related types:
ProcessExecOptionsProcessResult
Process is the main entry point for running commands.
let result := try Process.run("echo", ["hello"]) : e => { panic(e);};
print(result.stdout);ExecOptions describes how a command should be executed.
let opts := Process.options("ls");print(opts.command);Its fields include:
commandargscwdshellstdincheck
ProcessResult describes what happened after execution.
Its fields include:
commandstatussuccessstdoutstderr
Important Process functions include:
Process.options(...)Process.raw(...)Process.run(...)Process.run_in(...)Process.shell(...)Process.which(...)
For example:
let which_git := Process.which("git");print(which_git);Use these types when your program needs to run shell commands or other external programs and inspect their output.