Skip to content

Commit

Permalink
subcommand help improvement from tkausl
Browse files Browse the repository at this point in the history
  • Loading branch information
a-fas authored and sbcgua committed Dec 21, 2019
1 parent e33ca83 commit 602113c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1402,7 +1402,7 @@ Command.prototype.forwardSubcommands = function() {
unknown = parsed.unknown;

// Output help if necessary
if (unknown.includes('--help') || unknown.includes('-h')) {
if ((unknown.includes('--help') || unknown.includes('-h')) && (!args || !self.listeners('command:' + args[0]))) {
self.outputHelp();
process.exit(0);
}
Expand Down

0 comments on commit 602113c

Please sign in to comment.