Skip to content

Commit 4b72892

Browse files
committed
cmd/completion: Replace deprecated github.com/spf13/cobra API
The cobra.ExactValidArgs() API [1] was deprecated in Cobra 1.6.0 [2] in favour of combining different cobra.PositionalArgs. Commit 00f47b2 already bumped the required github.com/spf13/cobra version to 1.6.0, so adjust accordingly. [1] https://pkg.go.dev/github.com/spf13/cobra#ExactValidArgs [2] Cobra commit 70e53f62be77e03f spf13/cobra@70e53f62be77e03f spf13/cobra#1643 spf13/cobra#745 spf13/cobra#838 containers#1776
1 parent 00f47b2 commit 4b72892

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/cmd/completion.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ var completionCmd = &cobra.Command{
3232
Hidden: true,
3333
DisableFlagsInUseLine: true,
3434
ValidArgs: []string{"bash", "fish", "zsh"},
35-
Args: cobra.ExactValidArgs(1),
35+
Args: cobra.MatchAll(cobra.ExactArgs(1), cobra.OnlyValidArgs),
3636
RunE: completion,
3737
}
3838

0 commit comments

Comments
 (0)