Skip to content

Commit ea94a3d

Browse files
authored
undefined or nil Args default to ArbitraryArgs (#1612)
1 parent 7c9831d commit ea94a3d

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

command.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1012,7 +1012,7 @@ func (c *Command) ExecuteC() (cmd *Command, err error) {
10121012

10131013
func (c *Command) ValidateArgs(args []string) error {
10141014
if c.Args == nil {
1015-
return nil
1015+
return ArbitraryArgs(c, args)
10161016
}
10171017
return c.Args(c, args)
10181018
}

user_guide.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -326,8 +326,8 @@ In both of these cases:
326326

327327
## Positional and Custom Arguments
328328

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

332332
The following validators are built in:
333333

0 commit comments

Comments
 (0)