cli: rename --sync to --send (deprecation) and enhance description

This commit is contained in:
jean-emmanuel 2017-10-04 10:09:27 +02:00
parent ccadaac64a
commit 181edc521e

View file

@ -7,10 +7,17 @@ var baseDir = process.env[(process.platform == 'win32') ? 'USERPROFILE' : 'HOME'
ifaces = require('os').networkInterfaces()
var options = {
's':{alias:'sync',type:'array',describe:'synchronized hosts (ip:port pairs), used as default targets for all widgets',
's':{alias:'send',type:'array',describe:'default targets for all widgets (ip:port pairs)',
check: (s)=>{
return (s.join(' ').match('^([^:\s]*:[0-9]{4,5}[\s]*)*$') != null) ?
true : 'Sync hosts must be ip:port pairs & port must be >= 1024'
true : 'Targets must be ip:port pairs & port must be >= 1024'
}
},
'sync':{type:'array',describe:false,launcher:false,
check: (s)=>{
if (s) console.error('Warning: --sync is deprecated, use --send instead.')
return (s.join(' ').match('^([^:\s]*:[0-9]{4,5}[\s]*)*$') != null) ?
true : 'Targets must be ip:port pairs & port must be >= 1024'
}
},
'l':{alias:'load',type:'string',file:{name:'OSC Session (.json)', extensions: ['json', 'js']},describe:'session file to load'},