mirror of
https://github.com/ipfs/kubo.git
synced 2025-06-20 10:42:11 +08:00
commands: s/lenRequired/numRequired/
This commit is contained in:

committed by
Juan Batiz-Benet

parent
e14471f5e8
commit
eedc2e9cc7
@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user