Skip to content

Commit 702d41a

Browse files
authoredOct 8, 2021
fix: remove version from the help message for sub commands (#126)
1 parent abe662b commit 702d41a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed
 

‎src/Command.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -180,9 +180,12 @@ class Command {
180180
})
181181
}
182182

183-
const options = this.isGlobalCommand
183+
let options = this.isGlobalCommand
184184
? globalOptions
185185
: [...this.options, ...(globalOptions || [])]
186+
if (!this.isGlobalCommand) {
187+
options = options.filter((option) => option.name !== 'version')
188+
}
186189
if (options.length > 0) {
187190
const longestOptionName = findLongest(
188191
options.map((option) => option.rawName)

0 commit comments

Comments
 (0)
Please sign in to comment.