Commit 2d362f7a authored by alexpantyukhin's avatar alexpantyukhin Committed by Brad Fitzpatrick

flag: simplify arg logic in parseOne

Fixes #21763.

Change-Id: I59ee4f24c8064df64d9ede11aac02bc7ce4995b3
Reviewed-on: https://go-review.googlesource.com/61491Reviewed-by: default avatarDaniel Martí <mvdan@mvdan.cc>
Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent 6675fadf
......@@ -839,7 +839,7 @@ func (f *FlagSet) parseOne() (bool, error) {
return false, nil
}
s := f.args[0]
if len(s) == 0 || s[0] != '-' || len(s) == 1 {
if len(s) < 2 || s[0] != '-' {
return false, nil
}
numMinuses := 1
......
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