From 181edc521ea55df9e83bd89039bbadf28c935e1e Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Wed, 4 Oct 2017 10:09:27 +0200 Subject: [PATCH] cli: rename --sync to --send (deprecation) and enhance description --- app/main/settings.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/app/main/settings.js b/app/main/settings.js index 0e4fa0f0..160f4a90 100644 --- a/app/main/settings.js +++ b/app/main/settings.js @@ -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'},