Add negatable tag to set a bool to be negatable.

If negatable, add `--[no-]` prefix to help.
This commit is contained in:
Joe Schmitt
2021-02-18 10:55:55 -05:00
committed by Alec Thomas
parent 2a0d7af9c5
commit 2fdddc4f51
7 changed files with 34 additions and 5 deletions
+1 -1
View File
@@ -227,7 +227,6 @@ type Value struct {
Tag *Tag
Target reflect.Value
Required bool
Negated bool
Set bool // Set to true when this value is set through some mechanism.
Format string // Formatting directive, if applicable.
Position int // Position (for positional arguments).
@@ -370,6 +369,7 @@ type Flag struct {
Env string
Short rune
Hidden bool
Negated bool
}
func (f *Flag) String() string {