show option usage help with invalid `—node` option and simplied the valid option check to pure regex
This commit is contained in:
parent
203039763d
commit
269d544ab3
|
@ -278,6 +278,7 @@ class Cmd {
|
|||
const urlRegexExp = /^(vm|embark|((ws|https?):\/\/([a-zA-Z0-9_.-]*):?([0-9]*)?))$/i;
|
||||
if (!(node === 'embark' || node === 'vm' || node.match(urlRegexExp))) {
|
||||
console.error(`invalid --node option: must be 'vm', 'embark' or a valid URL`.red);
|
||||
options.outputHelp();
|
||||
process.exit(1);
|
||||
}
|
||||
options.node = node;
|
||||
|
|
Loading…
Reference in New Issue