mirror of
https://github.com/foomo/squadron.git
synced 2025-10-16 12:35:42 +00:00
fix: -- is not passed any more?
This commit is contained in:
parent
416bbfee34
commit
4d506fc6ff
@ -1,6 +1,8 @@
|
|||||||
package actions
|
package actions
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
|
|
||||||
"github.com/foomo/squadron"
|
"github.com/foomo/squadron"
|
||||||
@ -62,8 +64,11 @@ func newLogger(verbose bool) *logrus.Entry {
|
|||||||
func parseExtraArgs(args []string) (out []string, extraArgs []string) {
|
func parseExtraArgs(args []string) (out []string, extraArgs []string) {
|
||||||
for i, arg := range args {
|
for i, arg := range args {
|
||||||
if arg == "--" {
|
if arg == "--" {
|
||||||
out, extraArgs = args[:i], args[i+1:]
|
return args[:i], args[i+1:]
|
||||||
break
|
} else if strings.HasPrefix(arg, "--") && i > 0 {
|
||||||
|
return args[:i-1], args[i:]
|
||||||
|
} else if strings.HasPrefix(arg, "--") {
|
||||||
|
return nil, args
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user