API Reference › Os › Os.arg
method

Os.arg

Os.arg(i) -> string

The argument at index i. Index 0 is the program path; 1 onward are the launch arguments. Reading past arg_count() is out of bounds.

Parameters

ithe argument index (0 = the program path)

Example

program Arg {
  entry {
    let prog = Os.arg(0)   # the program path
    print(len(prog))
  }
}
← All symbols