Import std.os.process_command
Command
class
Public Class Command
A program to start, and what it starts with. It's found as a path, from the Folder it runs in when it's relative, or by its name on the PATH it gets, never in a current folder; on Windows, with .com or .exe after the name too. Its methods give the Command back, so they chain: Command("git").Arg("log").Folder(repo).Output(). It can start the program any number of times.
std/os/process_command.fb, line 68
-
A new Command that runs
program, with no arguments. -
Adds an argument, which the program gets as it is: nothing splits it, or reads quotes or anything else in it. On Windows, a .bat or .cmd file runs in cmd.exe, which gets one as Rust gives it there, so nothing in it runs: in quotes when it has anything but letters, digits, and #$*+-./:?@_, with each quote doubled, and every % kept from expanding, so the batch file reads it with %~1. One with a line break, which cmd.exe can't take, throws an IOError as it starts.
-
Adds the
arguments, in order, as Arg does. -
Sets the variable
nametovaluefor the program, whose environment is otherwise this program's. On Windows a name is the same in any case, so "Path" is "PATH". -
Takes the variable
nameout of the program's environment. On Windows, the ones every program needs, PATH, SYSTEMROOT, TEMP, and the like, stay, with this program's values. -
Starts the program with no variables but the ones Env sets after this, and on Windows the ones every program needs, as Unset leaves them.
-
Runs the program in
folder, not this program's current one. -
Where its stdin comes from.
-
Where its stdout goes.
-
Where its stderr goes.
-
Starts the program, which runs beside this one, and gives its Child, once what this program printed is out. Its streams are this program's unless Stdin, Stdout, or Stderr said otherwise. Throws an IOError when it can't start, one of NOT_FOUND for a program that isn't there. Panics when a text has a NUL, or a variable's name is empty or has an '=', which none can.
-
Runs the program to its end, and gives what it wrote to its stdout and stderr, and how it ended. Its stdin has nothing, or closes at once when Stdin pipes it. Throws and panics as Spawn does.
-
Output's Async twin, which waits on the main thread instead of blocking it.
-
Runs the program to its end, with this program's streams unless Stdin, Stdout, or Stderr said otherwise, and gives how it ended. Throws and panics as Spawn does.
-
Status's Async twin.
Report an issue with this page or with FutureBlitz on GitHub.