Skip to content

Commit

Permalink
Replace deprecated ExactValidArgs with MatchAll in user_guide and she…
Browse files Browse the repository at this point in the history
…ll_completions example (#1836)
  • Loading branch information
doniacld committed Oct 20, 2022
1 parent badcce1 commit 4b9d00d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion shell_completions.md
Expand Up @@ -71,7 +71,7 @@ PowerShell:
`,cmd.Root().Name()),
DisableFlagsInUseLine: true,
ValidArgs: []string{"bash", "zsh", "fish", "powershell"},
Args: cobra.ExactValidArgs(1),
Args: cobra.MatchAll(cobra.ExactArgs(1), cobra.OnlyValidArgs),
Run: func(cmd *cobra.Command, args []string) {
switch args[0] {
case "bash":
Expand Down
2 changes: 1 addition & 1 deletion user_guide.md
Expand Up @@ -349,7 +349,7 @@ shown below:
```go
var cmd = &cobra.Command{
Short: "hello",
Args: MatchAll(ExactArgs(2), OnlyValidArgs),
Args: cobra.MatchAll(cobra.ExactArgs(2), cobra.OnlyValidArgs),
Run: func(cmd *cobra.Command, args []string) {
fmt.Println("Hello, World!")
},
Expand Down

0 comments on commit 4b9d00d

Please sign in to comment.