aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoffrey F <[email protected]>2018-06-01 06:25:42 -0700
committerEric Paris <[email protected]>2018-06-01 09:25:42 -0400
commit3ebe029320b2676d667ae88da602a5f854788a8a (patch)
tree8059ddfc5da852ff466aabcd82e22a8f45e252b4
parent583c0c0531f06d5278b7d917446061adc344b5cd (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.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/flag.go b/flag.go
index 5eadc84..5cc710c 100644
--- a/flag.go
+++ b/flag.go
@@ -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]