Skip to content
Myr

Terminate the stripping of flags when -- is found (#649)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Di Xu · committed by Albert Nigmatzianov · parent c6c44e6 · Browse files · 1 file+3 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+3 added−0 removed

  • other:+3 added−0 removed

1 file+3 added−0 removed

modified:command.go+3 added
473 unmodified lines
474 for len(args) > 0 {475 s := args[0]476 args = args[1:]477 switch {478 case s == "--":479 // "--" terminates the flags480 break Loop481 case strings.HasPrefix(s, "--") && !strings.Contains(s, "=") && !hasNoOptDefVal(s[2:], flags):482 // If '--flag arg' then483 // delete arg from args.484 fallthrough // (do the same as below)
1023 unmodified lines