Skip to content

std/process

import "std/process" as process;
FunctionResult
argc() IntNumber of command-line arguments
argv(index: Int) StringArgument at index; index zero is the program path
cwd() StringCurrent working directory
exec(command: String) IntRuns a shell command and returns its status
exit(code: Int) VoidEnds the process
panic(message: String) VoidPrints to standard error and exits with code 1
import "std/process" as process;
fun main() Int {
if process.argc() < 2 {
eprintln("usage: app <name>");
return 1;
}
println("Hello, " + process.argv(1));
return 0;
}