Function in env compiler

args

fn args() -> Result<Vec<string>, EnvError>
Import
use env::{args};
Source: compiler/src/builtin_docs/env.hy

Returns the program’s command-line arguments, starting with the program name.

Always Ok. Needs no permission.

Returns#

Result<Vec<string>, EnvError>

Examples#

use env::{args};
use tests::assert;
let argv = match args() {
    Result::Ok(a) => a,
    Result::Err(_) => Vec::new(),
};
assert!(argv.len() >= 1);

See also#

  • var: Returns the value of the environment variable name.
  • set_var: Sets the environment variable name to value for this process.
  • remove_var: Removes the environment variable name from this process.
  • cwd: Returns the current working directory as an absolute path.
  • set_cwd: Changes the current working directory of the whole process.
  • exit: Ends the process at once with exit status code.
  • exec: Runs program with the arguments argv and waits for it to finish.
↑ ↓ navigate ↵ open