Skip to content

Commit

Permalink
Allow bubbling up of -test.* flags (#169)
Browse files Browse the repository at this point in the history
Based on patch suggested here: spf13/cobra#597 (comment)
  • Loading branch information
shin- authored and eparis committed Jun 1, 2018
1 parent 583c0c0 commit 3ebe029
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion flag.go
Original file line number Diff line number Diff line change
Expand Up @@ -990,11 +990,12 @@ func (f *FlagSet) parseLongArg(s string, args []string, fn parseFunc) (a []strin
}

func (f *FlagSet) parseSingleShortArg(shorthands string, args []string, fn parseFunc) (outShorts string, outArgs []string, err error) {
outArgs = args

if strings.HasPrefix(shorthands, "test.") {
return
}

outArgs = args
outShorts = shorthands[1:]
c := shorthands[0]

Expand Down

0 comments on commit 3ebe029

Please sign in to comment.