Add explicit usage to each command

The yargs framework combined with the pkg packaging causes the executable
name to be mangled on installation. For this reason, the usage should be
explicitly added to each command.
This commit is contained in:
Markus Mäkelä
2017-09-28 12:40:51 +03:00
parent c2283bbff1
commit f102a563e9
16 changed files with 102 additions and 51 deletions

View File

@ -128,7 +128,8 @@ exports.builder = function(yargs) {
.command('diff <target>', 'Show difference between host servers and <target>.', function(yargs) {
return yargs.epilog('The list of host servers is controlled with the --hosts option. ' +
'The target server should not be in the host list. Value of <target> ' +
'must be in HOST:PORT format');
'must be in HOST:PORT format')
.usage('Usage: cluster diff <target>')
}, function(argv) {
maxctrl(argv, function(host) {
@ -182,7 +183,8 @@ exports.builder = function(yargs) {
'command on that instance. Synchronization can be attempted again if a previous ' +
'attempt failed due to a network failure or some other ephemeral error. Any other ' +
'errors require manual synchronization of the MaxScale configuration files and a ' +
'restart of the failed Maxscale.');
'restart of the failed Maxscale.')
.usage('Usage: cluster sync <target>')
}, function(argv) {
maxctrl(argv, function(host) {
return getDiffs(argv.target, host)