From 9d39dd9b7f852a0d1b6fbd5e130bccff3065564c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 10 Dec 2022 17:23:44 +0000 Subject: [PATCH] fix(deps): update module github.com/urfave/cli/v2 to v2.23.7 --- go.mod | 2 +- go.sum | 2 ++ vendor/github.com/urfave/cli/v2/app.go | 4 ++++ vendor/github.com/urfave/cli/v2/command.go | 12 +++++------ vendor/github.com/urfave/cli/v2/flag.go | 9 +++++++- .../urfave/cli/v2/godoc-current.txt | 2 ++ vendor/github.com/urfave/cli/v2/help.go | 21 ++++++------------- vendor/modules.txt | 2 +- 8 files changed, 30 insertions(+), 24 deletions(-) diff --git a/go.mod b/go.mod index d36795a..9f85ec1 100644 --- a/go.mod +++ b/go.mod @@ -9,7 +9,7 @@ require ( github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect github.com/fatih/color v1.13.0 github.com/pkg/errors v0.9.1 - github.com/urfave/cli/v2 v2.23.5 + github.com/urfave/cli/v2 v2.23.7 ) require ( diff --git a/go.sum b/go.sum index a81622d..efcbc86 100644 --- a/go.sum +++ b/go.sum @@ -89,6 +89,8 @@ github.com/urfave/cli/v2 v2.20.3 h1:lOgGidH/N5loaigd9HjFsOIhXSTrzl7tBpHswZ428w4= github.com/urfave/cli/v2 v2.20.3/go.mod h1:1CNUng3PtjQMtRzJO4FMXBQvkGtuYRxxiR9xMa7jMwI= github.com/urfave/cli/v2 v2.23.5 h1:xbrU7tAYviSpqeR3X4nEFWUdB/uDZ6DE+HxmRU7Xtyw= github.com/urfave/cli/v2 v2.23.5/go.mod h1:GHupkWPMM0M/sj1a2b4wUrWBPzazNrIjouW6fmdJLxc= +github.com/urfave/cli/v2 v2.23.7 h1:YHDQ46s3VghFHFf1DdF+Sh7H4RqhcM+t0TmZRJx4oJY= +github.com/urfave/cli/v2 v2.23.7/go.mod h1:GHupkWPMM0M/sj1a2b4wUrWBPzazNrIjouW6fmdJLxc= github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU= github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= diff --git a/vendor/github.com/urfave/cli/v2/app.go b/vendor/github.com/urfave/cli/v2/app.go index e7f79c5..10198f4 100644 --- a/vendor/github.com/urfave/cli/v2/app.go +++ b/vendor/github.com/urfave/cli/v2/app.go @@ -107,6 +107,8 @@ type App struct { CustomAppHelpTemplate string // SliceFlagSeparator is used to customize the separator for SliceFlag, the default is "," SliceFlagSeparator string + // DisableSliceFlagSeparator is used to disable SliceFlagSeparator, the default is false + DisableSliceFlagSeparator bool // Boolean to enable short-option handling so user can combine several // single-character bool arguments into one // i.e. foobar -o -v -> foobar -ov @@ -264,6 +266,8 @@ func (a *App) Setup() { if len(a.SliceFlagSeparator) != 0 { defaultSliceFlagSeparator = a.SliceFlagSeparator } + + disableSliceFlagSeparator = a.DisableSliceFlagSeparator } func (a *App) newRootCommand() *Command { diff --git a/vendor/github.com/urfave/cli/v2/command.go b/vendor/github.com/urfave/cli/v2/command.go index c5939d4..da9cf53 100644 --- a/vendor/github.com/urfave/cli/v2/command.go +++ b/vendor/github.com/urfave/cli/v2/command.go @@ -136,6 +136,10 @@ func (c *Command) setup(ctx *Context) { newCmds = append(newCmds, scmd) } c.Subcommands = newCmds + + if c.BashComplete == nil { + c.BashComplete = DefaultCompleteWithFlags(c) + } } func (c *Command) Run(cCtx *Context, arguments ...string) (err error) { @@ -148,11 +152,7 @@ func (c *Command) Run(cCtx *Context, arguments ...string) (err error) { set, err := c.parseFlags(&a, cCtx.shellComplete) cCtx.flagSet = set - if c.isRoot { - if checkCompletions(cCtx) { - return nil - } - } else if checkCommandCompletions(cCtx, c.Name) { + if checkCompletions(cCtx) { return nil } @@ -203,7 +203,7 @@ func (c *Command) Run(cCtx *Context, arguments ...string) (err error) { cerr := cCtx.checkRequiredFlags(c.Flags) if cerr != nil { - _ = ShowSubcommandHelp(cCtx) + _ = helpCommand.Action(cCtx) return cerr } diff --git a/vendor/github.com/urfave/cli/v2/flag.go b/vendor/github.com/urfave/cli/v2/flag.go index b66a75d..5c0a8b7 100644 --- a/vendor/github.com/urfave/cli/v2/flag.go +++ b/vendor/github.com/urfave/cli/v2/flag.go @@ -15,7 +15,10 @@ import ( const defaultPlaceholder = "value" -var defaultSliceFlagSeparator = "," +var ( + defaultSliceFlagSeparator = "," + disableSliceFlagSeparator = false +) var ( slPfx = fmt.Sprintf("sl:::%d:::", time.Now().UTC().UnixNano()) @@ -380,5 +383,9 @@ func flagFromEnvOrFile(envVars []string, filePath string) (value string, fromWhe } func flagSplitMultiValues(val string) []string { + if disableSliceFlagSeparator { + return []string{val} + } + return strings.Split(val, defaultSliceFlagSeparator) } diff --git a/vendor/github.com/urfave/cli/v2/godoc-current.txt b/vendor/github.com/urfave/cli/v2/godoc-current.txt index b8dbf6a..6afd244 100644 --- a/vendor/github.com/urfave/cli/v2/godoc-current.txt +++ b/vendor/github.com/urfave/cli/v2/godoc-current.txt @@ -318,6 +318,8 @@ type App struct { CustomAppHelpTemplate string // SliceFlagSeparator is used to customize the separator for SliceFlag, the default is "," SliceFlagSeparator string + // DisableSliceFlagSeparator is used to disable SliceFlagSeparator, the default is false + DisableSliceFlagSeparator bool // Boolean to enable short-option handling so user can combine several // single-character bool arguments into one // i.e. foobar -o -v -> foobar -ov diff --git a/vendor/github.com/urfave/cli/v2/help.go b/vendor/github.com/urfave/cli/v2/help.go index 2ccd3b7..c7b8f55 100644 --- a/vendor/github.com/urfave/cli/v2/help.go +++ b/vendor/github.com/urfave/cli/v2/help.go @@ -227,7 +227,7 @@ func DefaultCompleteWithFlags(cmd *Command) func(cCtx *Context) { return } - printCommandSuggestions(cCtx.App.Commands, cCtx.App.Writer) + printCommandSuggestions(cCtx.Command.Subcommands, cCtx.App.Writer) } } @@ -308,15 +308,15 @@ func printVersion(cCtx *Context) { // ShowCompletions prints the lists of commands within a given context func ShowCompletions(cCtx *Context) { - a := cCtx.App - if a != nil && a.BashComplete != nil { - a.BashComplete(cCtx) + c := cCtx.Command + if c != nil && c.BashComplete != nil { + c.BashComplete(cCtx) } } // ShowCommandCompletions prints the custom completions for a given command func ShowCommandCompletions(ctx *Context, command string) { - c := ctx.App.Command(command) + c := ctx.Command.Command(command) if c != nil { if c.BashComplete != nil { c.BashComplete(ctx) @@ -453,7 +453,7 @@ func checkCompletions(cCtx *Context) bool { if args := cCtx.Args(); args.Present() { name := args.First() - if cmd := cCtx.App.Command(name); cmd != nil { + if cmd := cCtx.Command.Command(name); cmd != nil { // let the command handle the completion return false } @@ -463,15 +463,6 @@ func checkCompletions(cCtx *Context) bool { return true } -func checkCommandCompletions(c *Context, name string) bool { - if !c.shellComplete { - return false - } - - ShowCommandCompletions(c, name) - return true -} - func subtract(a, b int) int { return a - b } diff --git a/vendor/modules.txt b/vendor/modules.txt index a5fc874..415a88d 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -43,7 +43,7 @@ github.com/rivo/uniseg # github.com/russross/blackfriday/v2 v2.1.0 ## explicit github.com/russross/blackfriday/v2 -# github.com/urfave/cli/v2 v2.23.5 +# github.com/urfave/cli/v2 v2.23.7 ## explicit; go 1.18 github.com/urfave/cli/v2 # github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673