Skip to content
Myr

Replace deprecated ExactValidArgs with MatchAll in user_guide and shell_completions example (#1836)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by doniacld · committed by GitHub · parent badcce1 · Browse files · 2 files+2 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+2 added−2 removed

  • other:+2 added−2 removed

2 files+2 added−2 removed

modified:shell_completions.md+1 added-1 removed
69 unmodified lines
70 # and source this file from your PowerShell profile.71`,cmd.Root().Name()),72 DisableFlagsInUseLine: true,73 ValidArgs: []string{"bash", "zsh", "fish", "powershell"},74 Args: cobra.ExactValidArgs(1),74 Args: cobra.MatchAll(cobra.ExactArgs(1), cobra.OnlyValidArgs),75 Run: func(cmd *cobra.Command, args []string) {76 switch args[0] {77 case "bash":78 cmd.Root().GenBashCompletion(os.Stdout)
490 unmodified lines
modified:user_guide.md+1 added-1 removed
347 unmodified lines
348349```go350var cmd = &cobra.Command{351 Short: "hello",352 Args: MatchAll(ExactArgs(2), OnlyValidArgs),352 Args: cobra.MatchAll(cobra.ExactArgs(2), cobra.OnlyValidArgs),353 Run: func(cmd *cobra.Command, args []string) {354 fmt.Println("Hello, World!")355 },356}
338 unmodified lines