style(CLI): Improvements

This commit is contained in:
Mariusz Nowak 2020-07-08 11:44:46 +02:00 committed by Mariusz Nowak
parent 3dd915cd3f
commit b09d4255a7

View File

@ -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();