terminates the flags when -- is found in commandline

This commit is contained in:
Di Xu 2018-03-19 13:39:11 +08:00
parent c6c44e6fdc
commit 457f655af7

View file

@ -475,6 +475,9 @@ Loop:
s := args[0]
args = args[1:]
switch {
case s == "--":
// "--" terminates the flags
break Loop
case strings.HasPrefix(s, "--") && !strings.Contains(s, "=") && !hasNoOptDefVal(s[2:], flags):
// If '--flag arg' then
// delete arg from args.