arcanis / clipanion

Type-safe CLI library / framework with no runtime dependencies
https://mael.dev/clipanion/
1.1k stars 61 forks source link

can not turn off a boolean option / flag with default true value #123

Closed magicdawn closed 2 years ago

magicdawn commented 2 years ago
metadata = Option.Boolean('--metadata', true, {
  description: 'keep metadata',
})

I have a Boolean option, and defaults to true, in case we want to turn off default true, when called --metadata false, It shows error like

Unknown Syntax Error: Extraneous positional argument ("false")
d-fischer commented 2 years ago

I think the correct usage would be --no-metadata then, as documented.

arcanis commented 2 years ago

Indeed