1
0

Update module spf13/cobra to v1 (#511)

Update module spf13/cobra to v1

Reviewed-on: https://kolaente.dev/vikunja/api/pulls/511
This commit is contained in:
renovate
2020-05-14 19:09:06 +00:00
committed by konrad
parent 91a3b7aba2
commit 4533ac6b28
11 changed files with 855 additions and 61 deletions

View File

@ -57,6 +57,10 @@ type Command struct {
// ValidArgs is list of all valid non-flag arguments that are accepted in bash completions
ValidArgs []string
// ValidArgsFunction is an optional function that provides valid non-flag arguments for bash completion.
// It is a dynamic version of using ValidArgs.
// Only one of ValidArgs and ValidArgsFunction can be used for a command.
ValidArgsFunction func(cmd *Command, args []string, toComplete string) ([]string, ShellCompDirective)
// Expected arguments
Args PositionalArgs
@ -911,6 +915,9 @@ func (c *Command) ExecuteC() (cmd *Command, err error) {
args = os.Args[1:]
}
// initialize the hidden command to be used for bash completion
c.initCompleteCmd(args)
var flags []string
if c.TraverseChildren {
cmd, flags, err = c.Traverse(args)