Skip to content

Commit 550d0f7

Browse files
falstackegoist
authored andcommittedOct 6, 2021
fix: only output version message for root command
1 parent 5060bd9 commit 550d0f7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎src/CAC.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ class CAC extends EventEmitter {
220220
this.unsetMatchedCommand()
221221
}
222222

223-
if (this.options.version && this.showVersionOnExit) {
223+
if (this.options.version && this.showVersionOnExit && this.matchedCommandName === undefined) {
224224
this.outputVersion()
225225
run = false
226226
this.unsetMatchedCommand()

0 commit comments

Comments
 (0)
Please sign in to comment.