main: allow domain:port pairs in --send (#452)

This commit is contained in:
jean-emmanuel 2019-01-03 10:22:45 +01:00
parent 48361566ae
commit c5610cc688
2 changed files with 9 additions and 10 deletions

View file

@ -1,5 +1,11 @@
# Changelog
## next
- main
- `--send` accepts `ip:port` and `domain:port` targets
- removed previously deprecated `--sync` option
## 0.40.5
- bug fixes

View file

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