MXS-1300: Return a rejected promise for unknown commands

When an unknow command is executed, the core should return a rejected
promise.
This commit is contained in:
Markus Mäkelä
2017-07-22 01:26:20 +03:00
parent 84dc0b2d37
commit 5edfe3040e
16 changed files with 66 additions and 35 deletions

View File

@ -25,7 +25,9 @@ exports.builder = function(yargs) {
})
.usage('Usage: set <command>')
.help()
.command('*', 'the default command', {}, () => {
logger.log('Unknown command. See output of `help set` for a list of commands.')
.command('*', 'the default command', {}, function(argv) {
maxctrl(argv, function(host) {
return error('Unknown command. See output of `help set` for a list of commands.')
})
})
}