Consider:
.option(flags, description, defaultValue)
Commander types this to match the possible option value types (tj/commander.js#1721 (comment)), leaving aside coercion:
defaultValue?: string | boolean | string[]
which allow options defined with matching defaults like:
.option('--string <value>', 'description, 'DEFAULT') // string
.option('--boolean', 'description', false) // boolean
.option('--variadic <value...>, ['DEFAULT']) // string[]
In extra-typings we could restrict the default type to match the flag type?
Consider:
Commander types this to match the possible option value types (tj/commander.js#1721 (comment)), leaving aside coercion:
which allow options defined with matching defaults like:
In
extra-typingswe could restrict the default type to match the flag type?