From 27fb8db883cba484b90b2817dedfcb75474ef99f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 19 Aug 2026 21:15:56 +0000 Subject: [PATCH] build(deps): Bump github.com/urfave/cli/v3 from 3.10.1 to 3.11.0 Bumps [github.com/urfave/cli/v3](https://github.com/urfave/cli) from 3.10.1 to 3.11.0. - [Release notes](https://github.com/urfave/cli/releases) - [Changelog](https://github.com/urfave/cli/blob/main/docs/CHANGELOG.md) - [Commits](https://github.com/urfave/cli/compare/v3.10.1...v3.11.0) --- updated-dependencies: - dependency-name: github.com/urfave/cli/v3 dependency-version: 3.11.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 +- vendor/github.com/urfave/cli/v3/command.go | 3 ++ .../github.com/urfave/cli/v3/command_setup.go | 15 +++++- vendor/github.com/urfave/cli/v3/completion.go | 2 +- vendor/github.com/urfave/cli/v3/fish.go | 11 ++++- .../urfave/cli/v3/flag_bool_with_inverse.go | 2 +- vendor/github.com/urfave/cli/v3/flag_impl.go | 16 ++++-- vendor/github.com/urfave/cli/v3/flag_mutex.go | 49 +++++++++++++------ .../urfave/cli/v3/godoc-current.txt | 3 ++ vendor/github.com/urfave/cli/v3/help.go | 6 ++- .../urfave/cli/v3/mkdocs-requirements.txt | 2 +- vendor/modules.txt | 2 +- 13 files changed, 87 insertions(+), 30 deletions(-) diff --git a/go.mod b/go.mod index 218a53b290..f653b83fc9 100644 --- a/go.mod +++ b/go.mod @@ -23,7 +23,7 @@ require ( github.com/regclient/regclient v0.11.5 github.com/sirupsen/logrus v1.10.1 github.com/stretchr/testify v1.12.0 - github.com/urfave/cli/v3 v3.10.1 + github.com/urfave/cli/v3 v3.11.0 go.uber.org/zap v1.28.0 golang.org/x/mod v0.40.0 k8s.io/api v0.36.3 diff --git a/go.sum b/go.sum index b493b51371..400ee4e90d 100644 --- a/go.sum +++ b/go.sum @@ -230,8 +230,8 @@ github.com/tidwall/sjson v1.2.5 h1:kLy8mja+1c9jlljvWTlSazM7cKDRfJuR/bOJhcY5NcY= github.com/tidwall/sjson v1.2.5/go.mod h1:Fvgq9kS/6ociJEDnK0Fk1cpYF4FIW6ZF7LAe+6jwd28= github.com/ulikunitz/xz v0.5.15 h1:9DNdB5s+SgV3bQ2ApL10xRc35ck0DuIX/isZvIk+ubY= github.com/ulikunitz/xz v0.5.15/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= -github.com/urfave/cli/v3 v3.10.1 h1:7Kx9H50hrHbRbyxgO1KP6/BcbiGRz0uYh5YyQ30JEEY= -github.com/urfave/cli/v3 v3.10.1/go.mod h1:ysVLtOEmg2tOy6PknnYVhDoouyC/6N42TMeoMzskhso= +github.com/urfave/cli/v3 v3.11.0 h1:P/euJp99kb9p0tlVY+iYTLYYTAQlfl0hR2gUO1Img1Q= +github.com/urfave/cli/v3 v3.11.0/go.mod h1:ysVLtOEmg2tOy6PknnYVhDoouyC/6N42TMeoMzskhso= github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= github.com/xlab/treeprint v1.2.0 h1:HzHnuAF1plUN2zGlAFHbSQP2qJ0ZAD3XF5XD7OesXRQ= diff --git a/vendor/github.com/urfave/cli/v3/command.go b/vendor/github.com/urfave/cli/v3/command.go index 4cd907a558..f0cf9a715d 100644 --- a/vendor/github.com/urfave/cli/v3/command.go +++ b/vendor/github.com/urfave/cli/v3/command.go @@ -46,6 +46,9 @@ type Command struct { Flags []Flag `json:"flags"` // Boolean to hide built-in help command and help flag HideHelp bool `json:"hideHelp"` + // Boolean to hide the built-in help command. Applies to this command and + // all of its subcommands: as with HideHelp, a true value is inherited and + // a subcommand cannot turn it back off. // Ignored if HideHelp is true. HideHelpCommand bool `json:"hideHelpCommand"` // Boolean to hide built-in version flag and the VERSION section of help diff --git a/vendor/github.com/urfave/cli/v3/command_setup.go b/vendor/github.com/urfave/cli/v3/command_setup.go index 646e270ce7..13ef706315 100644 --- a/vendor/github.com/urfave/cli/v3/command_setup.go +++ b/vendor/github.com/urfave/cli/v3/command_setup.go @@ -24,7 +24,7 @@ func (cmd *Command) setupDefaults(osArgs []string) { cmd.ShellComplete = DefaultCompleteWithFlags } - if cmd.Name == "" && isRoot { + if cmd.Name == "" && isRoot && len(osArgs) > 0 { name := filepath.Base(osArgs[0]) tracef("setting cmd.Name from first arg basename (cmd=%[1]q)", name) cmd.Name = name @@ -227,6 +227,17 @@ func (cmd *Command) hideHelp() bool { return false } +func (cmd *Command) hideHelpCommand() bool { + tracef("hide help command (cmd=%[1]q)", cmd.Name) + for c := cmd; c != nil; c = c.parent { + if c.HideHelpCommand { + return true + } + } + + return false +} + func (cmd *Command) ensureHelp() { tracef("ensuring help (cmd=%[1]q)", cmd.Name) @@ -234,7 +245,7 @@ func (cmd *Command) ensureHelp() { if !cmd.hideHelp() { if cmd.Command(helpCommand.Name) == nil { - if !cmd.HideHelpCommand { + if !cmd.hideHelpCommand() { tracef("appending helpCommand (cmd=%[1]q)", cmd.Name) cmd.appendCommand(helpCommand) } diff --git a/vendor/github.com/urfave/cli/v3/completion.go b/vendor/github.com/urfave/cli/v3/completion.go index f14b01430a..b78dc385fd 100644 --- a/vendor/github.com/urfave/cli/v3/completion.go +++ b/vendor/github.com/urfave/cli/v3/completion.go @@ -59,7 +59,7 @@ source <($COMMAND completion zsh) $COMMAND completion fish > ~/.config/fish/completions/$COMMAND.fish # Powershell -Output the script to path/to/autocomplete/$COMMAND.ps1 an run it. +Output the script to path/to/autocomplete/$COMMAND.ps1 and run it. ` func buildCompletionCommand(appName string) *Command { diff --git a/vendor/github.com/urfave/cli/v3/fish.go b/vendor/github.com/urfave/cli/v3/fish.go index 8002a33ca1..1fac34a205 100644 --- a/vendor/github.com/urfave/cli/v3/fish.go +++ b/vendor/github.com/urfave/cli/v3/fish.go @@ -216,6 +216,15 @@ func commandAncestry(command *Command) string { return strings.Join(ancestry, "; and ") } +// escapeSingleQuotes escapes a string for use inside a fish single-quoted +// string, such as a `-d '...'` description. Within single quotes fish only +// recognizes the escape sequences \\ and \', so the backslash must be escaped +// as well as the single quote. Escaping the quote without escaping the +// backslash corrupts any description that contains a backslash, and a trailing +// backslash even leaves the single-quoted string unterminated. +// See https://fishshell.com/docs/current/language.html func escapeSingleQuotes(input string) string { - return strings.ReplaceAll(input, `'`, `\'`) + return fishSingleQuoteReplacer.Replace(input) } + +var fishSingleQuoteReplacer = strings.NewReplacer(`\`, `\\`, `'`, `\'`) diff --git a/vendor/github.com/urfave/cli/v3/flag_bool_with_inverse.go b/vendor/github.com/urfave/cli/v3/flag_bool_with_inverse.go index 199d22c7d9..33c0927257 100644 --- a/vendor/github.com/urfave/cli/v3/flag_bool_with_inverse.go +++ b/vendor/github.com/urfave/cli/v3/flag_bool_with_inverse.go @@ -219,7 +219,7 @@ func (bif *BoolWithInverseFlag) Count() int { // GetDefaultText returns the default text for this flag func (bif *BoolWithInverseFlag) GetDefaultText() string { - if bif.Required { + if bif.DefaultText != "" { return bif.DefaultText } return boolValue{}.ToString(bif.Value) diff --git a/vendor/github.com/urfave/cli/v3/flag_impl.go b/vendor/github.com/urfave/cli/v3/flag_impl.go index a67208c91c..be702d33f4 100644 --- a/vendor/github.com/urfave/cli/v3/flag_impl.go +++ b/vendor/github.com/urfave/cli/v3/flag_impl.go @@ -131,14 +131,22 @@ func (f *FlagBase[T, C, V]) PostParse() error { if !f.hasBeenSet { if val, source, found := f.Sources.LookupWithSource(); found { - if val != "" || reflect.TypeOf(f.Value).Kind() == reflect.String { + // reflect.TypeOf yields nil when T is an interface type (e.g. + // GenericFlag) and the value is nil, so the kind has to be + // derived defensively. + kind := reflect.Invalid + if ty := reflect.TypeOf(f.Value); ty != nil { + kind = ty.Kind() + } + + if val != "" || kind == reflect.String { if err := f.Set(f.Name, val); err != nil { return fmt.Errorf( "could not parse %[1]q as %[2]T value from %[3]s for flag %[4]s: %[5]s", val, f.Value, source, f.Name, err, ) } - } else if val == "" && reflect.TypeOf(f.Value).Kind() == reflect.Bool { + } else if val == "" && kind == reflect.Bool { _ = f.Set(f.Name, "false") } @@ -316,8 +324,10 @@ func (f *FlagBase[T, C, V]) SchemaType() string { // SchemaItemsType returns the JSON Schema element type for slice flags. func (f *FlagBase[T, C, V]) SchemaItemsType() string { var zero T + // reflect.TypeOf yields nil when T is an interface type (e.g. GenericFlag), + // in which case there are no slice elements to describe. t := reflect.TypeOf(zero) - if t.Kind() == reflect.Slice { + if t != nil && t.Kind() == reflect.Slice { switch t.Elem().Kind() { case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64: diff --git a/vendor/github.com/urfave/cli/v3/flag_mutex.go b/vendor/github.com/urfave/cli/v3/flag_mutex.go index 247bcb569b..5a1e87cfb5 100644 --- a/vendor/github.com/urfave/cli/v3/flag_mutex.go +++ b/vendor/github.com/urfave/cli/v3/flag_mutex.go @@ -17,32 +17,49 @@ type MutuallyExclusiveFlags struct { } func (grp MutuallyExclusiveFlags) check(_ *Command) error { - oneSet := false e := &mutuallyExclusiveGroup{} - for _, grpf := range grp.Flags { - for _, f := range grpf { - if f.IsSet() { - if oneSet { - e.flag2Name = f.Names()[0] - return e - } - e.flag1Name = f.Names()[0] - oneSet = true - break - } - if oneSet { - break - } + // Check for the use of a mutually-exclusive flag, starting at + // the first group. + name, i, ok := grp.findSetFlag(0) + if ok { + e.flag1Name = name + i++ + + // Check for the use of a flag in a mutually exclusive + // relationship with the one we just found. + if name2, _, ok := grp.findSetFlag(i); ok { + e.flag2Name = name2 + return e } } - if !oneSet && grp.Required { + if !ok && grp.Required { return &mutuallyExclusiveGroupRequiredFlag{flags: &grp} } + return nil } +// findSetFlag is used in [MutuallyExclusiveFlags.check] to find +// whether at least one flag inside a mutually exclusive flag group is +// set. If so, return the flag name, position at which it's set, and +// Boolean true (indicating that a flag was found.) Else, return all +// zero values. +func (grp MutuallyExclusiveFlags) findSetFlag(startIdx int) (string, int, bool) { + for i := startIdx; i < len(grp.Flags); i++ { + flags := grp.Flags[i] + + for _, flg := range flags { + if flg.IsSet() { + return flg.Names()[0], i, true + } + } + } + + return "", 0, false +} + func (grp MutuallyExclusiveFlags) propagateCategory() { for _, grpf := range grp.Flags { for _, f := range grpf { diff --git a/vendor/github.com/urfave/cli/v3/godoc-current.txt b/vendor/github.com/urfave/cli/v3/godoc-current.txt index d680c5f544..b3e9797175 100644 --- a/vendor/github.com/urfave/cli/v3/godoc-current.txt +++ b/vendor/github.com/urfave/cli/v3/godoc-current.txt @@ -464,6 +464,9 @@ type Command struct { Flags []Flag `json:"flags"` // Boolean to hide built-in help command and help flag HideHelp bool `json:"hideHelp"` + // Boolean to hide the built-in help command. Applies to this command and + // all of its subcommands: as with HideHelp, a true value is inherited and + // a subcommand cannot turn it back off. // Ignored if HideHelp is true. HideHelpCommand bool `json:"hideHelpCommand"` // Boolean to hide built-in version flag and the VERSION section of help diff --git a/vendor/github.com/urfave/cli/v3/help.go b/vendor/github.com/urfave/cli/v3/help.go index 4bedf87d5d..a0f6c8cd5d 100644 --- a/vendor/github.com/urfave/cli/v3/help.go +++ b/vendor/github.com/urfave/cli/v3/help.go @@ -216,7 +216,7 @@ func printFlagSuggestions(lastArg string, flags []Flag, writer io.Writer) { // Trim to handle both "-short" and "--long" flags. cur := strings.TrimLeft(lastArg, "-") for _, flag := range flags { - if bflag, ok := flag.(*BoolFlag); ok && bflag.Hidden { + if vf, ok := flag.(VisibleFlag); ok && !vf.IsVisible() { continue } @@ -476,6 +476,10 @@ func checkShellCompleteFlag(c *Command, arguments []string) (bool, []string) { return false, arguments } + if len(arguments) == 0 { + return false, arguments + } + pos := len(arguments) - 1 lastArg := arguments[pos] diff --git a/vendor/github.com/urfave/cli/v3/mkdocs-requirements.txt b/vendor/github.com/urfave/cli/v3/mkdocs-requirements.txt index 701403ae56..479c8e8abb 100644 --- a/vendor/github.com/urfave/cli/v3/mkdocs-requirements.txt +++ b/vendor/github.com/urfave/cli/v3/mkdocs-requirements.txt @@ -1,5 +1,5 @@ mkdocs-git-revision-date-localized-plugin==1.5.3 -mkdocs-material==9.7.6 +mkdocs-material==9.7.7 mkdocs==1.6.1 mkdocs-redirects==1.2.3 pygments==2.20.0 diff --git a/vendor/modules.txt b/vendor/modules.txt index c1e4b8038d..25cff2742c 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -414,7 +414,7 @@ github.com/ulikunitz/xz github.com/ulikunitz/xz/internal/hash github.com/ulikunitz/xz/internal/xlog github.com/ulikunitz/xz/lzma -# github.com/urfave/cli/v3 v3.10.1 +# github.com/urfave/cli/v3 v3.11.0 ## explicit; go 1.22 github.com/urfave/cli/v3 # github.com/x448/float16 v0.8.4