🏃Run
Running a Stof document with the CLI.
> stof run <OPTIONS> <FILE>.stof
Options
-a, --allow <ALLOW>
Add an additional library to use by name. By default, the CLI gives access to read and write files on the system (for imports), but nothing else. If for example you want to give Stof access to the network, you'll need to pass "-a http".
http - Gives Stof an HTTP interface for making network calls.
github - Gives Stof access to additional files hosted on GitHub via the GitHub API. A package manger will be released soon.
Hello World
file: hello.stof
#[main]
fn main() {
pln("hello world");
}
> stof run hello.stof
hello world
Multiple Mains
Stof can have #[main] functions anywhere in the document. Their order of execution is not deterministic and will change. For more info on function attributes, see Functions.
file: mains.stof
#[main]
fn doSomething() {
pln("does something");
}
#[main]
fn doAnother() {
pln("doing another thing");
}
> stof run mains.stof
does something
doing another thing
Last updated
Was this helpful?