diff --git a/Documentation/Reference/MaxCtrl.md b/Documentation/Reference/MaxCtrl.md index 31eabdf39..c6faa8907 100644 --- a/Documentation/Reference/MaxCtrl.md +++ b/Documentation/Reference/MaxCtrl.md @@ -41,8 +41,8 @@ All command accept the following global options. -u, --user Username to use [string] [default: "admin"] -p, --password Password for the user [string] [default: "mariadb"] -h, --hosts List of MaxScale hosts. The hosts must be in HOST:PORT format - and each value must be separated by spaces. - [array] [default: "localhost:8989"] + and each value must be separated by a comma. + [string] [default: "localhost:8989"] -s, --secure Enable HTTPS requests [boolean] [default: "false"] -t, --timeout Request timeout in milliseconds [number] [default: "10000"] -q, --quiet Silence all output [boolean] [default: "false"] diff --git a/Documentation/Release-Notes/MaxScale-2.2.1-Release-Notes.md b/Documentation/Release-Notes/MaxScale-2.2.1-Release-Notes.md index f550aecaa..e00be51b7 100644 --- a/Documentation/Release-Notes/MaxScale-2.2.1-Release-Notes.md +++ b/Documentation/Release-Notes/MaxScale-2.2.1-Release-Notes.md @@ -155,6 +155,12 @@ behavior is advised. The top filter now uses the session ID instead of an internal counter for the names of the log file names. +### MaxCtrl + +The `-h, --hosts` argument was changed to accept a list of hostnames separated +by commas instead of spaces. This prevents commands from accidentally being +interpreted as hostnames. + ## Dropped Features ## New Features diff --git a/maxctrl/lib/common.js b/maxctrl/lib/common.js index fee2d51f8..9372c28fa 100644 --- a/maxctrl/lib/common.js +++ b/maxctrl/lib/common.js @@ -26,6 +26,9 @@ module.exports = function() { // servers. this.maxctrl = function(argv, cb) { + // Split the hostnames, separated by commas + argv.hosts = argv.hosts.split(',') + this.argv = argv if (!argv.hosts || argv.hosts.length < 1) { diff --git a/maxctrl/lib/core.js b/maxctrl/lib/core.js index 6162ab5a6..7a3c34ee5 100644 --- a/maxctrl/lib/core.js +++ b/maxctrl/lib/core.js @@ -38,9 +38,9 @@ program .option('h', { alias: 'hosts', describe: 'List of MaxScale hosts. The hosts must be in ' + - 'HOST:PORT format and each value must be separated by spaces.', + 'HOST:PORT format and each value must be separated by a comma.', default: 'localhost:8989', - type: 'array' + type: 'string' }) .option('s', { alias: 'secure',