Skip to content

Commit

Permalink
fix cli args parser
Browse files Browse the repository at this point in the history
  • Loading branch information
somdev-rhl committed Nov 13, 2022
1 parent 05eadf8 commit 8e4ac42
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions internal/core/argparser.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,14 +171,13 @@ func ParseArgs() (map[string]string, []string, bool) {
}
cleaned, action := whatToDo(thisArgName, lastAction)
if action == 1 {
if groups != nil {
if len(groups) == 3 && groups[2] != "" {
argPair[cleaned] = groups[2]
lastAction = 0
continue
} else {
argPair[cleaned] = strings.Replace(token, thisArgName+"=", "", 1)
}
lastArg = cleaned
lastAction = 0
continue
} else if action == 0 {
argPair[cleaned] = ""
} else if action == 2 {
Expand All @@ -202,7 +201,7 @@ func ParseArgs() (map[string]string, []string, bool) {
}
lastAction = action
}
if lastAction == 1 {
if lastAction == 1 && len(argPair) < 1 {
return argPair, extra, true
}
return argPair, extra, false
Expand Down

0 comments on commit 8e4ac42

Please sign in to comment.