diff options
| author | Joffrey F <[email protected]> | 2018-06-01 06:25:42 -0700 |
|---|---|---|
| committer | Eric Paris <[email protected]> | 2018-06-01 09:25:42 -0400 |
| commit | 3ebe029320b2676d667ae88da602a5f854788a8a (patch) | |
| tree | 8059ddfc5da852ff466aabcd82e22a8f45e252b4 | |
| parent | 583c0c0531f06d5278b7d917446061adc344b5cd (diff) | |
Allow bubbling up of -test.* flags (#169)
Based on patch suggested here: https://github.com/spf13/cobra/issues/597#issuecomment-385984076
| -rw-r--r-- | flag.go | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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] |
