Skip to content

Commit

Permalink
Terminate the stripping of flags when -- is found (#649)
Browse files Browse the repository at this point in the history
  • Loading branch information
dixudx authored and n10v committed Mar 19, 2018
1 parent c6c44e6 commit c439c4f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions command.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit c439c4f

Please sign in to comment.