From 83cda2e699598d65afa48ac0372e4fc9bea58944 Mon Sep 17 00:00:00 2001 From: Matt Bell Date: Tue, 4 Nov 2014 23:40:15 -0800 Subject: [PATCH] commands/http: Fixed arg parse bug --- commands/http/parse.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/commands/http/parse.go b/commands/http/parse.go index 59e626bca..b23240739 100644 --- a/commands/http/parse.go +++ b/commands/http/parse.go @@ -61,17 +61,18 @@ func Parse(r *http.Request, root *cmds.Command) (cmds.Request, error) { if valCount <= lenRequired && !argDef.Required { continue } - valCount-- if argDef.Type == cmds.ArgString { if argDef.Variadic { for _, s := range stringArgs { args = append(args, s) } + valCount -= len(stringArgs) } else if len(stringArgs) > 0 { args = append(args, stringArgs[0]) stringArgs = stringArgs[1:] + valCount-- } else { break