Skip to content

Commit

Permalink
undefined or nil Args default to ArbitraryArgs
Browse files Browse the repository at this point in the history
  • Loading branch information
umarcor committed Apr 21, 2022
1 parent 89d7b83 commit 39e4e44
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion command.go
Original file line number Diff line number Diff line change
Expand Up @@ -1012,7 +1012,7 @@ func (c *Command) ExecuteC() (cmd *Command, err error) {

func (c *Command) ValidateArgs(args []string) error {
if c.Args == nil {
return nil
return ArbitraryArgs(c, args)
}
return c.Args(c, args)
}
Expand Down
4 changes: 2 additions & 2 deletions user_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -326,8 +326,8 @@ In both of these cases:

## Positional and Custom Arguments

Validation of positional arguments can be specified using the `Args` field
of `Command`.
Validation of positional arguments can be specified using the `Args` field of `Command`.
If `Args` is undefined or `nil`, it defaults to `ArbitraryArgs`.

The following validators are built in:

Expand Down

0 comments on commit 39e4e44

Please sign in to comment.