diff --git a/src/Command.ts b/src/Command.ts index 11ee87e..005c37c 100644 --- a/src/Command.ts +++ b/src/Command.ts @@ -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)