main: allow passing extra options to --custom-module and make them available through global object "options"

This commit is contained in:
jean-emmanuel 2019-01-03 17:54:54 +01:00
parent c5610cc688
commit 6b7bdcf0a0
5 changed files with 9 additions and 5 deletions

View file

@ -56,6 +56,7 @@ The module is executed in a restricted context, only a few globals are available
- `clearInterval`: `function(interval)`
- `settings.read`: `function(name)`, see [settings.js](https://github.com/jean-emmanuel/open-stage-control/blob/master/app/main/settings.js#L125-L162) for available options
- `app`: an [event emitter](https://nodejs.org/api/events.html#events_class_eventemitter) for monitoring the events sent by the different clients. Event names can be found in [callbacks.js](https://github.com/jean-emmanuel/open-stage-control/blob/master/app/main/callbacks.js), callbacks are called with 2 arguments: `data` (object) and `clientId` (string)
- `options`: `array` containing the extra options passed to `--custom-module` after the filename
`sendOsc` and `receiveOsc` expect arguments formatted as follow:

View file

@ -17,7 +17,7 @@ Below are the available command-line options. Note that when running without any
| `-l` | `--load` | session file to load |
| | `--state` | state file to load (osc messages will be sent, unless there are other clients connected) |
| `-b` | `--blank` | load a blank session and start the editor |
| `-c` | `--custom-module` | custom module file to load |
| `-c` | `--custom-module` | custom module file to load (custom options can be passed after the filename) |
| `-p` | `--port` | http port of the server (default to 8080) |
| `-o` | `--osc-port` | osc input port (default to --port) |
| | `--tcp-port` | tcp server input port |