This commit is contained in:
Lynn Cyrin 2019-09-11 20:28:48 -07:00
parent 49dbeed687
commit 10682fbde6
No known key found for this signature in database
GPG Key ID: EE9CCB427DFEC897

View File

@ -252,8 +252,11 @@ func reorderArgs(commandFlags []Flag, args []string) []string {
} }
func argIsFlag(commandFlags []Flag, arg string) bool { func argIsFlag(commandFlags []Flag, arg string) bool {
// this line turns `--flag` into `flag`
arg = strings.ReplaceAll(arg, "-", "") arg = strings.ReplaceAll(arg, "-", "")
// this line turns `flag=value` into `flag`
arg = strings.Split(arg, "=")[0] arg = strings.Split(arg, "=")[0]
// look through all the flags, to see if the `arg` is one of our flags
for _, flag := range commandFlags { for _, flag := range commandFlags {
for _, key := range strings.Split(flag.GetName(), ",") { for _, key := range strings.Split(flag.GetName(), ",") {
if key == arg { if key == arg {