Update go dependencies

This commit is contained in:
Manuel Alejandro de Brito Fontes 2019-06-27 10:34:47 -04:00
parent 2586542608
commit 6db1ed390d
No known key found for this signature in database
GPG key ID: 786136016A8BA02A
64 changed files with 13497 additions and 11319 deletions

View file

@ -78,6 +78,18 @@ func ExactArgs(n int) PositionalArgs {
}
}
// ExactValidArgs returns an error if
// there are not exactly N positional args OR
// there are any positional args that are not in the `ValidArgs` field of `Command`
func ExactValidArgs(n int) PositionalArgs {
return func(cmd *Command, args []string) error {
if err := ExactArgs(n)(cmd, args); err != nil {
return err
}
return OnlyValidArgs(cmd, args)
}
}
// RangeArgs returns an error if the number of args is not within the expected range.
func RangeArgs(min int, max int) PositionalArgs {
return func(cmd *Command, args []string) error {