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

bugfix: duplicate help command #197

Merged
merged 2 commits into from
Dec 5, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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)