OxL Reference

module std.os

std.os — process arguments, environment, exit (II.1).

Example:

oxl✓ checked in CI
use std.os { args, env, setenv }

fn main() io {
  setenv("OXL_MODULE_EXAMPLE", "on")
  print("{args().len() >= 1} {env("OXL_MODULE_EXAMPLE") ?? "unset"}")
}
Output
true on

Functions

argsCommand line: args()[0] is the program name, user arguments follow.
envEnvironment variable, none if unset (same as the prelude env).
exitTerminates the process with code (output is flushed).
setenvSets an environment variable of this process (same as the prelude setenv).

See also