Skip to main content

Module env

Module env 

Source
Expand description

Environment Variable and Argument Access

Provides access to environment variables and command-line arguments.

§Platform Support

  • Native: Full access to system environment
  • WASM: Not available (module not compiled for wasm32)

§Example

use logicaffeine_system::env;

// Read environment variable
if let Some(home) = env::get("HOME".to_string()) {
    assert!(!home.is_empty());
}

// Command-line arguments are always available
let args = env::args();
assert!(!args.is_empty());

Functions§

args
Returns command-line arguments as a vector.
get
Returns the value of an environment variable.