From b09d4255a7832bbda63d08f87b8ebbaf2a2c121d Mon Sep 17 00:00:00 2001 From: Mariusz Nowak Date: Wed, 8 Jul 2020 11:44:46 +0200 Subject: [PATCH] style(CLI): Improvements --- lib/classes/CLI.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) 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();