Skip to content

Commit

Permalink
A flag should not be a value for another flag. Fixes #32
Browse files Browse the repository at this point in the history
  • Loading branch information
aalmiray committed Oct 7, 2020
1 parent b3a3e53 commit 339118c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions gum/flag.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,12 @@ func ParseArgs(args []string) ParsedArgs {
// grab the next value if available
j := i + 1
if j < len(args) {
flags.Tool = append(flags.Tool, args[j])
i = j
arg := args[j]
// add it only if it's not another flag
if arg[0] != '-' {
flags.Tool = append(flags.Tool, arg)
i = j
}
}
}
} else {
Expand Down

0 comments on commit 339118c

Please sign in to comment.