From 9ff4ff1ae6bd4d4e8e6bd9f0608f3465966cd3ae Mon Sep 17 00:00:00 2001 From: Guoqiang Chen Date: Mon, 19 Mar 2018 08:48:03 +0000 Subject: [PATCH] Fixes issue if arg is "-" --- command_line_parser.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/command_line_parser.go b/command_line_parser.go index 2afdf3d..d60c5ef 100644 --- a/command_line_parser.go +++ b/command_line_parser.go @@ -19,7 +19,7 @@ func (c *commandline) parse(arguments []string) (err error) { if arg == "--" { c.args = append(c.args, arguments[i+1:]...) break - } else if strings.HasPrefix(arg, "-") { + } else if strings.HasPrefix(arg, "-") && arg != "-" { peekedNext, err := c.parseOneArg(i, arguments) if err != nil { return err