go-flags
go-flags copied to clipboard
add --no-flag for --flag boolean flags
may be add a configuration negavtive:"true"
to the DSL to indicate which flags should receive --no-* automatically? wdyt?
The design of boolean flags has been that you only ever can turn them enabled, not disabled. See #80 and #175 for previous discussion.
I'm trying to use the ini support as a "default" file, where we enable a boolean flag, and need an easy way to disable it from the CLI.
Using a custom Bool
type adds some overhead -- now the user always has to specify --flagname=true
rather than just --flagname
. The ideal option would be using --no-flagname
, but this is not easy to do outside of the library. We'd have to create a second flag, post-process the struct to flip flagname to false, etc.
Having a configuration option in Options
to automatically register --no-flagname
for booleans would be ideal, does that seem OK to you?