OxL Справочник OxL
РусскийEnglish

module std.os

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

Example:

oxl✓ проверяется в CI
use std.os { args, env, setenv }

fn main() io {
  setenv("OXL_MODULE_EXAMPLE", "on")
  print("{args().len() >= 1} {env("OXL_MODULE_EXAMPLE") ?? "unset"}")
}
Вывод
true on

Функции

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).

См. также