1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-06-20 19:19:06 +08:00

commands: s/lenRequired/numRequired/

This commit is contained in:
Matt Bell
2014-11-11 16:48:15 -08:00
committed by Juan Batiz-Benet
parent e14471f5e8
commit eedc2e9cc7

View File

@ -159,10 +159,10 @@ func (c *Command) CheckArguments(req Request) error {
} }
// count required argument definitions // count required argument definitions
lenRequired := 0 numRequired := 0
for _, argDef := range c.Arguments { for _, argDef := range c.Arguments {
if argDef.Required { if argDef.Required {
lenRequired++ numRequired++
} }
} }
@ -170,7 +170,7 @@ func (c *Command) CheckArguments(req Request) error {
j := 0 j := 0
for _, argDef := range c.Arguments { for _, argDef := range c.Arguments {
// skip optional argument definitions if there aren't sufficient remaining values // skip optional argument definitions if there aren't sufficient remaining values
if len(args)-j <= lenRequired && !argDef.Required { if len(args)-j <= numRequired && !argDef.Required {
continue continue
} }