Skip to content

Commit 0b4a7b4

Browse files
committed
[docs] command line argument handling
1 parent 367388c commit 0b4a7b4

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

docs/References/Command Line Options.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@
55

66
You use following command line options when starting NW.js to change some default behaviors.
77

8+
## About command line arguments
9+
10+
When a user uses your app to open a file under command line, like `your-app file.txt file2.txt`, the `file.txt file2.txt` will be recorded and you can use [nw.App.argv](App.md) to get the array of command line arguments. If there is already one running instance of your app, the full command line of the second instance will be passed to the existing instance by sending `open` event to the `App` object.
11+
12+
!!! note
13+
For now there is a limitation: if the command line argument is the filename of .js file on disk, NW will just run it as upstream Node.js. This is for supporting `child_process.fork()` API.
14+
815
## `--url`
916

1017
Load URL with the default app: `--url=http://nwjs.io`

0 commit comments

Comments
 (0)