Skip to content

Commit c439c4f

Browse files
dixudxn10v
authored andcommitted
Terminate the stripping of flags when -- is found (#649)
1 parent c6c44e6 commit c439c4f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

command.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -475,6 +475,9 @@ Loop:
475475
s := args[0]
476476
args = args[1:]
477477
switch {
478+
case s == "--":
479+
// "--" terminates the flags
480+
break Loop
478481
case strings.HasPrefix(s, "--") && !strings.Contains(s, "=") && !hasNoOptDefVal(s[2:], flags):
479482
// If '--flag arg' then
480483
// delete arg from args.

0 commit comments

Comments
 (0)