Files
wren/doc/site/modules/process/process.markdown
Bob Nystrom 71e2458a6c Add API for accessing command-line arguments.
- Add process module with Process class.
- Add "arguments" and "allArguments" methods.
- Docs for same.
- Support passing additional arguments to command line.
- Add "--help" support to command line.
2016-01-22 07:57:26 -08:00

831 B

^title Process Class

The Process class lets you work with operating processes, including the currently running one.

Static Methods

allArguments

The list of command-line arguments that were passed when the Wren process was spawned. This includes the Wren executable itself, the path to the file being run (if any), and any other options passed to Wren itself.

If you run:

:::bash
$ wren file.wren arg

This returns:

:::wren
System.print(Process.allArguments) //> ["wren", "file.wren", "arg"]

arguments

The list of command-line arguments that were passed to your program when the Wren process was spawned. This does not include arguments handled by Wren itself.

If you run:

:::bash
$ wren file.wren arg

This returns:

:::wren
System.print(Process.arguments) //> ["arg"]