Add a Platform class.

- Rename the "process" module to "os".
- Add Platform to it.
- Static "name" method.
- Static "isPosix" method.
- Docs and tests!
This commit is contained in:
Bob Nystrom
2016-05-21 12:44:17 -07:00
parent 6bcc64eb61
commit 06731f66d4
20 changed files with 170 additions and 65 deletions
+38
View File
@@ -0,0 +1,38 @@
^title Process Class
The Process class lets you work with operating system 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"]