Commit f6281e5a authored by Matt Bell's avatar Matt Bell Committed by Juan Batiz-Benet

commands/http: s/lenRequired/numRequired/

parent 24b64654
......@@ -42,10 +42,10 @@ func Parse(r *http.Request, root *cmds.Command) (cmds.Request, error) {
args := make([]interface{}, 0)
// count required argument definitions
lenRequired := 0
numRequired := 0
for _, argDef := range cmd.Arguments {
if argDef.Required {
lenRequired++
numRequired++
}
}
......@@ -58,10 +58,10 @@ func Parse(r *http.Request, root *cmds.Command) (cmds.Request, error) {
for _, argDef := range cmd.Arguments {
// skip optional argument definitions if there aren't sufficient remaining values
if valCount <= lenRequired && !argDef.Required {
if valCount <= numRequired && !argDef.Required {
continue
} else if argDef.Required {
lenRequired--
numRequired--
}
if argDef.Type == cmds.ArgString {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment