1
0
Fork 0
mirror of https://github.com/vbatts/go-mtree.git synced 2025-07-14 02:39:11 +00:00

go: go get -u ./... && go mod vendor && go mod tidy

Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
This commit is contained in:
Vincent Batts 2023-10-07 09:59:06 -04:00
parent a9c6969125
commit e73ff94ef9
Signed by: vbatts
GPG key ID: E30EFAA812C6E5ED
162 changed files with 1835 additions and 2997 deletions

View file

@ -56,6 +56,7 @@ func (cCtx *Context) Set(name, value string) error {
// IsSet determines if the flag was actually set
func (cCtx *Context) IsSet(name string) bool {
if fs := cCtx.lookupFlagSet(name); fs != nil {
isSet := false
fs.Visit(func(f *flag.Flag) {
@ -72,7 +73,23 @@ func (cCtx *Context) IsSet(name string) bool {
return false
}
return f.IsSet()
if f.IsSet() {
return true
}
// now redo flagset search on aliases
aliases := f.Names()
fs.Visit(func(f *flag.Flag) {
for _, alias := range aliases {
if f.Name == alias {
isSet = true
}
}
})
if isSet {
return true
}
}
return false
@ -204,9 +221,10 @@ func (cCtx *Context) checkRequiredFlags(flags []Flag) requiredFlagsErr {
var flagPresent bool
var flagName string
for _, key := range f.Names() {
flagName = key
flagNames := f.Names()
flagName = flagNames[0]
for _, key := range flagNames {
if cCtx.IsSet(strings.TrimSpace(key)) {
flagPresent = true
}