From 55670a559102cc07e2912cff0474e833c6b43759 Mon Sep 17 00:00:00 2001 From: Matt Bell Date: Tue, 4 Nov 2014 00:42:58 -0800 Subject: [PATCH] commands/http: Cleaned up argument handling in Parse --- commands/http/parse.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/commands/http/parse.go b/commands/http/parse.go index f40b02324bc..c9168f3e380 100644 --- a/commands/http/parse.go +++ b/commands/http/parse.go @@ -45,9 +45,17 @@ func Parse(r *http.Request, root *cmds.Command) (cmds.Request, error) { for _, arg := range cmd.Arguments { if arg.Type == cmds.ArgString { - for j := 0; len(stringArgs) > 0 && arg.Variadic || j == 0; j++ { + if arg.Variadic { + for _, s := range stringArgs { + args = append(args, s) + } + + } else if len(stringArgs) > 0 { args = append(args, stringArgs[0]) stringArgs = stringArgs[1:] + + } else { + break } } else {