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:
@ -40,6 +40,6 @@ exports.builder = function(yargs) {
|
||||
.usage('Usage: alter <command>')
|
||||
.help()
|
||||
.command('*', 'the default command', {}, () => {
|
||||
console.log('Unknown command. See output of `help alter` for a list of commands.')
|
||||
logger.log('Unknown command. See output of `help alter` for a list of commands.')
|
||||
})
|
||||
}
|
||||
|
@ -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.')
|
||||
})
|
||||
}
|
||||
|
@ -25,6 +25,6 @@ exports.builder = function(yargs) {
|
||||
.usage('Usage: clear <command>')
|
||||
.help()
|
||||
.command('*', 'the default command', {}, () => {
|
||||
console.log('Unknown command. See output of `help clear` for a list of commands.')
|
||||
logger.log('Unknown command. See output of `help clear` for a list of commands.')
|
||||
})
|
||||
}
|
||||
|
@ -181,6 +181,6 @@ exports.builder = function(yargs) {
|
||||
.usage('Usage: create <command>')
|
||||
.help()
|
||||
.command('*', 'the default command', {}, () => {
|
||||
console.log('Unknown command. See output of `help create` for a list of commands.')
|
||||
logger.log('Unknown command. See output of `help create` for a list of commands.')
|
||||
})
|
||||
}
|
||||
|
@ -36,6 +36,6 @@ exports.builder = function(yargs) {
|
||||
.usage('Usage: destroy <command>')
|
||||
.help()
|
||||
.command('*', 'the default command', {}, () => {
|
||||
console.log('Unknown command. See output of `help destroy` for a list of commands.')
|
||||
logger.log('Unknown command. See output of `help destroy` for a list of commands.')
|
||||
})
|
||||
}
|
||||
|
@ -48,6 +48,6 @@ exports.builder = function(yargs) {
|
||||
.usage('Usage: disable <command>')
|
||||
.help()
|
||||
.command('*', 'the default command', {}, () => {
|
||||
console.log('Unknown command. See output of `help disable` for a list of commands.')
|
||||
logger.log('Unknown command. See output of `help disable` for a list of commands.')
|
||||
})
|
||||
}
|
||||
|
@ -54,6 +54,6 @@ exports.builder = function(yargs) {
|
||||
.usage('Usage: enable <command>')
|
||||
.help()
|
||||
.command('*', 'the default command', {}, () => {
|
||||
console.log('Unknown command. See output of `help enable` for a list of commands.')
|
||||
logger.log('Unknown command. See output of `help enable` for a list of commands.')
|
||||
})
|
||||
}
|
||||
|
@ -44,6 +44,6 @@ exports.builder = function(yargs) {
|
||||
.usage('Usage: link <command>')
|
||||
.help()
|
||||
.command('*', 'the default command', {}, () => {
|
||||
console.log('Unknown command. See output of `help link` for a list of commands.')
|
||||
logger.log('Unknown command. See output of `help link` for a list of commands.')
|
||||
})
|
||||
}
|
||||
|
@ -87,6 +87,6 @@ exports.builder = function(yargs) {
|
||||
.usage('Usage: list <command>')
|
||||
.help()
|
||||
.command('*', 'the default command', {}, () => {
|
||||
console.log('Unknown command. See output of `help list` for a list of commands.')
|
||||
logger.log('Unknown command. See output of `help list` for a list of commands.')
|
||||
})
|
||||
}
|
||||
|
@ -24,6 +24,6 @@ exports.builder = function(yargs) {
|
||||
.usage('Usage: rotate <command>')
|
||||
.help()
|
||||
.command('*', 'the default command', {}, () => {
|
||||
console.log('Unknown command. See output of `help rotate` for a list of commands.')
|
||||
logger.log('Unknown command. See output of `help rotate` for a list of commands.')
|
||||
})
|
||||
}
|
||||
|
@ -25,6 +25,6 @@ exports.builder = function(yargs) {
|
||||
.usage('Usage: set <command>')
|
||||
.help()
|
||||
.command('*', 'the default command', {}, () => {
|
||||
console.log('Unknown command. See output of `help set` for a list of commands.')
|
||||
logger.log('Unknown command. See output of `help set` for a list of commands.')
|
||||
})
|
||||
}
|
||||
|
@ -111,6 +111,6 @@ exports.builder = function(yargs) {
|
||||
.usage('Usage: show <command>')
|
||||
.help()
|
||||
.command('*', 'the default command', {}, () => {
|
||||
console.log('Unknown command. See output of `help show` for a list of commands.')
|
||||
logger.log('Unknown command. See output of `help show` for a list of commands.')
|
||||
})
|
||||
}
|
||||
|
@ -28,6 +28,6 @@ exports.builder = function(yargs) {
|
||||
.usage('Usage: start <command>')
|
||||
.help()
|
||||
.command('*', 'the default command', {}, () => {
|
||||
console.log('Unknown command. See output of `help start` for a list of commands.')
|
||||
logger.log('Unknown command. See output of `help start` for a list of commands.')
|
||||
})
|
||||
}
|
||||
|
@ -28,6 +28,6 @@ exports.builder = function(yargs) {
|
||||
.usage('Usage: stop <command>')
|
||||
.help()
|
||||
.command('*', 'the default command', {}, () => {
|
||||
console.log('Unknown command. See output of `help stop` for a list of commands.')
|
||||
logger.log('Unknown command. See output of `help stop` for a list of commands.')
|
||||
})
|
||||
}
|
||||
|
@ -44,6 +44,6 @@ exports.builder = function(yargs) {
|
||||
.usage('Usage: unlink <command>')
|
||||
.help()
|
||||
.command('*', 'the default command', {}, () => {
|
||||
console.log('Unknown command. See output of `help unlink` for a list of commands.')
|
||||
logger.log('Unknown command. See output of `help unlink` for a list of commands.')
|
||||
})
|
||||
}
|
||||
|
Reference in New Issue
Block a user