diff --git a/lib/classes/CLI.js b/lib/classes/CLI.js index 8d488eac2..d92221ab3 100644 --- a/lib/classes/CLI.js +++ b/lib/classes/CLI.js @@ -68,11 +68,7 @@ class CLI { const options = processedInput.options; // if asked for version explicitly - if ( - options.version || - options.v || - (commands.length === 1 && commands.indexOf('version') > -1) - ) { + if (options.version || options.v || (commands.length === 1 && commands[0] === 'version')) { this.getVersionNumber(); return true; } @@ -89,7 +85,7 @@ class CLI { // If no commands and asked for help specifically (commands.length === 0 && (options.help || options.h)) || // If asked for help specifically via "help" command - (commands.length === 1 && commands.indexOf('help') > -1) + (commands.length === 1 && commands[0] === 'help') ) { if (options.verbose) { this.generateVerboseHelp();