Skip to content
This repository has been archived by the owner on Sep 1, 2022. It is now read-only.

Commit

Permalink
bugfix: duplicate help command (#197)
Browse files Browse the repository at this point in the history
* bugfix: duplicate help command

* yvm help is not an invalid command
  • Loading branch information
jakebolam committed Dec 5, 2018
1 parent 325620c commit 95b8c23
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/yvm.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ if (!process.argv.includes('exec')) {
argParser
.command('*', '', {noHelp: true, isDefault: true})
.action((invalidCommand) => {
log(`Invalid command: ${invalidCommand}`);
if (!process.argv.includes('help')) {
log(`Invalid command: ${invalidCommand}`);
}
argParser.outputHelp();
process.exit(1);
});
Expand Down Expand Up @@ -135,10 +137,5 @@ argParser
.description('Updates yvm to the latest version')
.action(invalidCommandLog);

argParser
.command('help')
.description('Show help text')
.action(() => argParser.outputHelp());

/* eslint-enable global-require,prettier/prettier */
argParser.parse(process.argv)

0 comments on commit 95b8c23

Please sign in to comment.