diff --git a/command.go b/command.go index 228942f3b..ddbe5ec24 100644 --- a/command.go +++ b/command.go @@ -1006,15 +1006,16 @@ func (c *Command) ExecuteC() (cmd *Command, err error) { return cmd, err } -// ValidateArgs returns an error if any positional args are not in -// the `ValidArgs` field of `Command` +// ValidateArgs returns an error if any positional args are not in the +// `ValidArgs` field of `Command`. Then, run the `Args` validator, if +// specified. func (c *Command) ValidateArgs(args []string) error { - if c.Args == nil { - return nil - } if err := validateArgs(c, args); err != nil { return err } + if c.Args == nil { + return nil + } return c.Args(c, args) }