From 3ebe029320b2676d667ae88da602a5f854788a8a Mon Sep 17 00:00:00 2001 From: Joffrey F Date: Fri, 1 Jun 2018 06:25:42 -0700 Subject: Allow bubbling up of -test.* flags (#169) Based on patch suggested here: https://github.com/spf13/cobra/issues/597#issuecomment-385984076 --- flag.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'flag.go') 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] -- cgit v1.2.3