fix: add an xorprefix:"..." option for prefixing xor/and groups
Fixes #343
This commit is contained in:
@@ -48,6 +48,7 @@ type Tag struct {
|
||||
Vars Vars
|
||||
Prefix string // Optional prefix on anonymous structs. All sub-flags will have this prefix.
|
||||
EnvPrefix string
|
||||
XorPrefix string // Optional prefix on XOR/AND groups.
|
||||
Embed bool
|
||||
Aliases []string
|
||||
Negatable string
|
||||
@@ -268,6 +269,7 @@ func hydrateTag(t *Tag, typ reflect.Type) error { //nolint: gocyclo
|
||||
}
|
||||
t.Prefix = t.Get("prefix")
|
||||
t.EnvPrefix = t.Get("envprefix")
|
||||
t.XorPrefix = t.Get("xorprefix")
|
||||
t.Embed = t.Has("embed")
|
||||
if t.Has("negatable") {
|
||||
if !isBool && !isBoolPtr {
|
||||
|
||||
Reference in New Issue
Block a user