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

@ -16,7 +16,7 @@ var options = {
'l':{alias:'load',type:'string',file:{name:'OSC Session (.json)', extensions: ['json', 'js']},describe:'session file to load'},
'state':{type:'string',file:{name:'OSC State (.state)', extensions: ['state']},describe:'state file to load'},
'b':{alias:'blank',type:'boolean',describe:'load a blank session and start the editor'},
'c':{alias:'custom-module',type:'string',file:{name:'OSC Custom module (.js)', extensions: ['js']},describe:'custom module file to load'},
'c':{alias:'custom-module',type:'array',file:{name:'OSC Custom module (.js)', extensions: ['js']},describe:'custom module file to load (custom options can be passed after the filename)'},
'p':{alias:'port',type:'number',describe:'http port of the server (default to 8080)',
check: (p)=>{
return (!isNaN(p) && p > 1023 && parseInt(p)===p) ?