MXS-1300: Make output optional

Minor refactoring to the core library to allow multiple calls from within
the same program.

Added --quiet option to silence output so that tests aren't so
verbose. Currently this only works on UNIX based systems.
This commit is contained in:
Markus Mäkelä
2017-07-14 16:36:59 +03:00
parent ec5b0fea39
commit d938dcc701
18 changed files with 116 additions and 89 deletions

View File

@ -35,13 +35,13 @@ exports.builder = function(yargs) {
return maxctrl
.doAsyncRequest('maxscale/modules/' + argv.module + '/' + argv.command + '?' + argv.parameters.join('&'),
function(resp) {
console.log(JSON.stringify(resp, null, 4))
logger.log(JSON.stringify(resp, null, 4))
}, { method: verb })
})
})
.usage('Usage: call <command>')
.help()
.command('*', 'the default command', {}, () => {
console.log('Unknown command. See output of `help call` for a list of commands.')
logger.log('Unknown command. See output of `help call` for a list of commands.')
})
}