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

commands/http: Fixed arg parse bug

parent fecb434a
...@@ -61,17 +61,18 @@ func Parse(r *http.Request, root *cmds.Command) (cmds.Request, error) { ...@@ -61,17 +61,18 @@ func Parse(r *http.Request, root *cmds.Command) (cmds.Request, error) {
if valCount <= lenRequired && !argDef.Required { if valCount <= lenRequired && !argDef.Required {
continue continue
} }
valCount--
if argDef.Type == cmds.ArgString { if argDef.Type == cmds.ArgString {
if argDef.Variadic { if argDef.Variadic {
for _, s := range stringArgs { for _, s := range stringArgs {
args = append(args, s) args = append(args, s)
} }
valCount -= len(stringArgs)
} else if len(stringArgs) > 0 { } else if len(stringArgs) > 0 {
args = append(args, stringArgs[0]) args = append(args, stringArgs[0])
stringArgs = stringArgs[1:] stringArgs = stringArgs[1:]
valCount--
} else { } else {
break break
......
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