Skip to content
Myr

undefined or nil Args default to ArbitraryArgs (#1612)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Unai Martinez-Corral · committed by GitHub · parent 7c9831d · Browse files · 2 files+3 added−3 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+3 added−3 removed

  • other:+3 added−3 removed

2 files+3 added−3 removed

modified:command.go+1 added-1 removed
1010 unmodified lines
1011}10121013func (c *Command) ValidateArgs(args []string) error {1014 if c.Args == nil {1015 return nil1015 return ArbitraryArgs(c, args)1016 }1017 return c.Args(c, args)1018}1019
676 unmodified lines
modified:user_guide.md+2 added-2 removed
324 unmodified lines
325 - a group may contain any number of flags326327## Positional and Custom Arguments328329Validation of positional arguments can be specified using the `Args` field330of `Command`.329Validation of positional arguments can be specified using the `Args` field of `Command`.330If `Args` is undefined or `nil`, it defaults to `ArbitraryArgs`.331332The following validators are built in:333334- `NoArgs` - the command will report an error if there are any positional args.
332 unmodified lines