mirror of
https://github.com/open-cluster-management-io/ocm.git
synced 2026-02-14 10:00:11 +00:00
🌱 Bump github.com/spf13/pflag from 1.0.7 to 1.0.10 (#1247)
Bumps [github.com/spf13/pflag](https://github.com/spf13/pflag) from 1.0.7 to 1.0.10. - [Release notes](https://github.com/spf13/pflag/releases) - [Commits](https://github.com/spf13/pflag/compare/v1.0.7...v1.0.10) --- updated-dependencies: - dependency-name: github.com/spf13/pflag dependency-version: 1.0.10 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
This commit is contained in:
2
go.mod
2
go.mod
@@ -23,7 +23,7 @@ require (
|
||||
github.com/pkg/errors v0.9.1
|
||||
github.com/prometheus/client_golang v1.23.0
|
||||
github.com/spf13/cobra v1.9.1
|
||||
github.com/spf13/pflag v1.0.7
|
||||
github.com/spf13/pflag v1.0.10
|
||||
github.com/stretchr/testify v1.11.1
|
||||
github.com/valyala/fasttemplate v1.2.2
|
||||
google.golang.org/grpc v1.68.1
|
||||
|
||||
4
go.sum
4
go.sum
@@ -344,8 +344,8 @@ github.com/spf13/cast v1.7.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cA
|
||||
github.com/spf13/cobra v1.9.1 h1:CXSaggrXdbHK9CF+8ywj8Amf7PBRmPCOJugH954Nnlo=
|
||||
github.com/spf13/cobra v1.9.1/go.mod h1:nDyEzZ8ogv936Cinf6g1RU9MRY64Ir93oCnqb9wxYW0=
|
||||
github.com/spf13/pflag v1.0.6/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
|
||||
github.com/spf13/pflag v1.0.7 h1:vN6T9TfwStFPFM5XzjsvmzZkLuaLX+HS+0SeFLRgU6M=
|
||||
github.com/spf13/pflag v1.0.7/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
|
||||
github.com/spf13/pflag v1.0.10 h1:4EBh2KAYBwaONj6b2Ye1GiHfwjqyROoF4RwYO+vPwFk=
|
||||
github.com/spf13/pflag v1.0.10/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
|
||||
github.com/stoewer/go-strcase v1.3.0 h1:g0eASXYtp+yvN9fK8sH94oCIk0fau9uV1/ZdJ0AVEzs=
|
||||
github.com/stoewer/go-strcase v1.3.0/go.mod h1:fAH5hQ5pehh+j3nZfvwdk2RgEgQjAoM8wodgtPmh1xo=
|
||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
|
||||
36
vendor/github.com/spf13/pflag/flag.go
generated
vendored
36
vendor/github.com/spf13/pflag/flag.go
generated
vendored
@@ -137,12 +137,17 @@ const (
|
||||
PanicOnError
|
||||
)
|
||||
|
||||
// ParseErrorsWhitelist defines the parsing errors that can be ignored
|
||||
type ParseErrorsWhitelist struct {
|
||||
// ParseErrorsAllowlist defines the parsing errors that can be ignored
|
||||
type ParseErrorsAllowlist struct {
|
||||
// UnknownFlags will ignore unknown flags errors and continue parsing rest of the flags
|
||||
UnknownFlags bool
|
||||
}
|
||||
|
||||
// ParseErrorsWhitelist defines the parsing errors that can be ignored.
|
||||
//
|
||||
// Deprecated: use [ParseErrorsAllowlist] instead. This type will be removed in a future release.
|
||||
type ParseErrorsWhitelist = ParseErrorsAllowlist
|
||||
|
||||
// NormalizedName is a flag name that has been normalized according to rules
|
||||
// for the FlagSet (e.g. making '-' and '_' equivalent).
|
||||
type NormalizedName string
|
||||
@@ -158,8 +163,13 @@ type FlagSet struct {
|
||||
// help/usage messages.
|
||||
SortFlags bool
|
||||
|
||||
// ParseErrorsWhitelist is used to configure a whitelist of errors
|
||||
ParseErrorsWhitelist ParseErrorsWhitelist
|
||||
// ParseErrorsAllowlist is used to configure an allowlist of errors
|
||||
ParseErrorsAllowlist ParseErrorsAllowlist
|
||||
|
||||
// ParseErrorsAllowlist is used to configure an allowlist of errors.
|
||||
//
|
||||
// Deprecated: use [FlagSet.ParseErrorsAllowlist] instead. This field will be removed in a future release.
|
||||
ParseErrorsWhitelist ParseErrorsAllowlist
|
||||
|
||||
name string
|
||||
parsed bool
|
||||
@@ -928,7 +938,6 @@ func VarP(value Value, name, shorthand, usage string) {
|
||||
// returns the error.
|
||||
func (f *FlagSet) fail(err error) error {
|
||||
if f.errorHandling != ContinueOnError {
|
||||
fmt.Fprintln(f.Output(), err)
|
||||
f.usage()
|
||||
}
|
||||
return err
|
||||
@@ -986,6 +995,8 @@ func (f *FlagSet) parseLongArg(s string, args []string, fn parseFunc) (a []strin
|
||||
f.usage()
|
||||
return a, ErrHelp
|
||||
case f.ParseErrorsWhitelist.UnknownFlags:
|
||||
fallthrough
|
||||
case f.ParseErrorsAllowlist.UnknownFlags:
|
||||
// --unknown=unknownval arg ...
|
||||
// we do not want to lose arg in this case
|
||||
if len(split) >= 2 {
|
||||
@@ -1044,6 +1055,8 @@ func (f *FlagSet) parseSingleShortArg(shorthands string, args []string, fn parse
|
||||
err = ErrHelp
|
||||
return
|
||||
case f.ParseErrorsWhitelist.UnknownFlags:
|
||||
fallthrough
|
||||
case f.ParseErrorsAllowlist.UnknownFlags:
|
||||
// '-f=arg arg ...'
|
||||
// we do not want to lose arg in this case
|
||||
if len(shorthands) > 2 && shorthands[1] == '=' {
|
||||
@@ -1158,12 +1171,12 @@ func (f *FlagSet) Parse(arguments []string) error {
|
||||
}
|
||||
f.parsed = true
|
||||
|
||||
f.args = make([]string, 0, len(arguments))
|
||||
|
||||
if len(arguments) == 0 {
|
||||
return nil
|
||||
}
|
||||
|
||||
f.args = make([]string, 0, len(arguments))
|
||||
|
||||
set := func(flag *Flag, value string) error {
|
||||
return f.Set(flag.Name, value)
|
||||
}
|
||||
@@ -1174,7 +1187,10 @@ func (f *FlagSet) Parse(arguments []string) error {
|
||||
case ContinueOnError:
|
||||
return err
|
||||
case ExitOnError:
|
||||
fmt.Println(err)
|
||||
if err == ErrHelp {
|
||||
os.Exit(0)
|
||||
}
|
||||
fmt.Fprintln(f.Output(), err)
|
||||
os.Exit(2)
|
||||
case PanicOnError:
|
||||
panic(err)
|
||||
@@ -1200,6 +1216,10 @@ func (f *FlagSet) ParseAll(arguments []string, fn func(flag *Flag, value string)
|
||||
case ContinueOnError:
|
||||
return err
|
||||
case ExitOnError:
|
||||
if err == ErrHelp {
|
||||
os.Exit(0)
|
||||
}
|
||||
fmt.Fprintln(f.Output(), err)
|
||||
os.Exit(2)
|
||||
case PanicOnError:
|
||||
panic(err)
|
||||
|
||||
34
vendor/github.com/spf13/pflag/golangflag.go
generated
vendored
34
vendor/github.com/spf13/pflag/golangflag.go
generated
vendored
@@ -8,6 +8,7 @@ import (
|
||||
goflag "flag"
|
||||
"reflect"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
// go test flags prefixes
|
||||
@@ -113,6 +114,38 @@ func (f *FlagSet) AddGoFlagSet(newSet *goflag.FlagSet) {
|
||||
f.addedGoFlagSets = append(f.addedGoFlagSets, newSet)
|
||||
}
|
||||
|
||||
// CopyToGoFlagSet will add all current flags to the given Go flag set.
|
||||
// Deprecation remarks get copied into the usage description.
|
||||
// Whenever possible, a flag gets added for which Go flags shows
|
||||
// a proper type in the help message.
|
||||
func (f *FlagSet) CopyToGoFlagSet(newSet *goflag.FlagSet) {
|
||||
f.VisitAll(func(flag *Flag) {
|
||||
usage := flag.Usage
|
||||
if flag.Deprecated != "" {
|
||||
usage += " (DEPRECATED: " + flag.Deprecated + ")"
|
||||
}
|
||||
|
||||
switch value := flag.Value.(type) {
|
||||
case *stringValue:
|
||||
newSet.StringVar((*string)(value), flag.Name, flag.DefValue, usage)
|
||||
case *intValue:
|
||||
newSet.IntVar((*int)(value), flag.Name, *(*int)(value), usage)
|
||||
case *int64Value:
|
||||
newSet.Int64Var((*int64)(value), flag.Name, *(*int64)(value), usage)
|
||||
case *uintValue:
|
||||
newSet.UintVar((*uint)(value), flag.Name, *(*uint)(value), usage)
|
||||
case *uint64Value:
|
||||
newSet.Uint64Var((*uint64)(value), flag.Name, *(*uint64)(value), usage)
|
||||
case *durationValue:
|
||||
newSet.DurationVar((*time.Duration)(value), flag.Name, *(*time.Duration)(value), usage)
|
||||
case *float64Value:
|
||||
newSet.Float64Var((*float64)(value), flag.Name, *(*float64)(value), usage)
|
||||
default:
|
||||
newSet.Var(flag.Value, flag.Name, usage)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// ParseSkippedFlags explicitly Parses go test flags (i.e. the one starting with '-test.') with goflag.Parse(),
|
||||
// since by default those are skipped by pflag.Parse().
|
||||
// Typical usage example: `ParseGoTestFlags(os.Args[1:], goflag.CommandLine)`
|
||||
@@ -125,3 +158,4 @@ func ParseSkippedFlags(osArgs []string, goFlagSet *goflag.FlagSet) error {
|
||||
}
|
||||
return goFlagSet.Parse(skippedFlags)
|
||||
}
|
||||
|
||||
|
||||
10
vendor/github.com/spf13/pflag/string_to_string.go
generated
vendored
10
vendor/github.com/spf13/pflag/string_to_string.go
generated
vendored
@@ -4,6 +4,7 @@ import (
|
||||
"bytes"
|
||||
"encoding/csv"
|
||||
"fmt"
|
||||
"sort"
|
||||
"strings"
|
||||
)
|
||||
|
||||
@@ -62,8 +63,15 @@ func (s *stringToStringValue) Type() string {
|
||||
}
|
||||
|
||||
func (s *stringToStringValue) String() string {
|
||||
keys := make([]string, 0, len(*s.value))
|
||||
for k := range *s.value {
|
||||
keys = append(keys, k)
|
||||
}
|
||||
sort.Strings(keys)
|
||||
|
||||
records := make([]string, 0, len(*s.value)>>1)
|
||||
for k, v := range *s.value {
|
||||
for _, k := range keys {
|
||||
v := (*s.value)[k]
|
||||
records = append(records, k+"="+v)
|
||||
}
|
||||
|
||||
|
||||
8
vendor/github.com/spf13/pflag/time.go
generated
vendored
8
vendor/github.com/spf13/pflag/time.go
generated
vendored
@@ -48,7 +48,13 @@ func (d *timeValue) Type() string {
|
||||
return "time"
|
||||
}
|
||||
|
||||
func (d *timeValue) String() string { return d.Time.Format(time.RFC3339Nano) }
|
||||
func (d *timeValue) String() string {
|
||||
if d.Time.IsZero() {
|
||||
return ""
|
||||
} else {
|
||||
return d.Time.Format(time.RFC3339Nano)
|
||||
}
|
||||
}
|
||||
|
||||
// GetTime return the time value of a flag with the given name
|
||||
func (f *FlagSet) GetTime(name string) (time.Time, error) {
|
||||
|
||||
2
vendor/modules.txt
vendored
2
vendor/modules.txt
vendored
@@ -602,7 +602,7 @@ github.com/spf13/cast
|
||||
# github.com/spf13/cobra v1.9.1
|
||||
## explicit; go 1.15
|
||||
github.com/spf13/cobra
|
||||
# github.com/spf13/pflag v1.0.7
|
||||
# github.com/spf13/pflag v1.0.10
|
||||
## explicit; go 1.12
|
||||
github.com/spf13/pflag
|
||||
# github.com/stoewer/go-strcase v1.3.0
|
||||
|
||||
Reference in New Issue
Block a user