mirror of
https://github.com/spf13/cobra
synced 2025-05-05 04:47:22 +00:00
Update args.go
Call function on properly on iterator variable
This commit is contained in:
parent
ca8e3c2779
commit
aed9e6d54a
1 changed files with 1 additions and 1 deletions
2
args.go
2
args.go
|
@ -44,7 +44,7 @@ func OnlyValidArgs(cmd *Command, args []string) error {
|
|||
|
||||
for _, v := range args {
|
||||
if !stringInSlice(v, validArgs) {
|
||||
return fmt.Errorf("invalid argument %q for %q%s", v, cmd.CommandPath(), cmd.findSuggestions(args[0]))
|
||||
return fmt.Errorf("invalid argument %q for %q%s", v, cmd.CommandPath(), cmd.findSuggestions(v))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue