Update args.go

Call function on properly on iterator variable
This commit is contained in:
Steven Zelek 2022-06-08 14:31:23 -07:00 committed by GitHub
parent ca8e3c2779
commit aed9e6d54a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -44,7 +44,7 @@ func OnlyValidArgs(cmd *Command, args []string) error {
for _, v := range args { for _, v := range args {
if !stringInSlice(v, validArgs) { 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))
} }
} }
} }