Skip to content

Commit

Permalink
fix: remove version from the help message for sub commands (#126)
Browse files Browse the repository at this point in the history
  • Loading branch information
falstack authored Oct 8, 2021
1 parent abe662b commit 702d41a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,12 @@ class Command {
})
}

const options = this.isGlobalCommand
let options = this.isGlobalCommand
? globalOptions
: [...this.options, ...(globalOptions || [])]
if (!this.isGlobalCommand) {
options = options.filter((option) => option.name !== 'version')
}
if (options.length > 0) {
const longestOptionName = findLongest(
options.map((option) => option.rawName)
Expand Down

0 comments on commit 702d41a

Please sign in to comment.