Update vendor directory

This commit is contained in:
Nicholas Thompson
2021-04-23 22:14:34 +02:00
parent 321d19c5c2
commit e201779341
726 changed files with 124438 additions and 104379 deletions

View File

@@ -325,19 +325,19 @@ func writeCommandIni(command *Command, namespace string, writer io.Writer, optio
})
for _, c := range command.commands {
var nns string
var fqn string
if c.Hidden {
continue
}
if len(namespace) != 0 {
nns = c.Name + "." + nns
fqn = namespace + "." + c.Name
} else {
nns = c.Name
fqn = c.Name
}
writeCommandIni(c, nns, writer, options)
writeCommandIni(c, fqn, writer, options)
}
}
@@ -499,13 +499,21 @@ func (i *IniParser) matchingGroups(name string) []*Group {
func (i *IniParser) parse(ini *ini) error {
p := i.parser
p.eachOption(func(cmd *Command, group *Group, option *Option) {
option.clearReferenceBeforeSet = true
})
var quotesLookup = make(map[*Option]bool)
for name, section := range ini.Sections {
groups := i.matchingGroups(name)
if len(groups) == 0 {
return newErrorf(ErrUnknownGroup, "could not find option group `%s'", name)
if (p.Options & IgnoreUnknown) == None {
return newErrorf(ErrUnknownGroup, "could not find option group `%s'", name)
}
continue
}
for _, inival := range section {
@@ -537,9 +545,8 @@ func (i *IniParser) parse(ini *ini) error {
continue
}
// ini value is ignored if override is set and
// value was previously set from non default
if i.ParseAsDefaults && !opt.isSetDefault {
// ini value is ignored if parsed as default but defaults are prevented
if i.ParseAsDefaults && opt.preventDefault {
continue
}
@@ -572,7 +579,15 @@ func (i *IniParser) parse(ini *ini) error {
}
}
if err := opt.set(pval); err != nil {
var err error
if i.ParseAsDefaults {
err = opt.setDefault(pval)
} else {
err = opt.set(pval)
}
if err != nil {
return &IniError{
Message: err.Error(),
File: ini.File,
@@ -580,6 +595,9 @@ func (i *IniParser) parse(ini *ini) error {
}
}
// Defaults from ini files take precendence over defaults from parser
opt.preventDefault = true
// either all INI values are quoted or only values who need quoting
if _, ok := quotesLookup[opt]; !inival.Quoted || !ok {
quotesLookup[opt] = inival.Quoted