Fix incorrect merge of pflag.CommandLine to cmd.Flags()

Fix #443
This commit is contained in:
Albert Nigmatzianov
2017-05-12 20:22:26 +02:00
parent 3454e0e28e
commit 7d22e77cce
3 changed files with 24 additions and 8 deletions

View File

@ -1150,12 +1150,12 @@ func TestGlobalNormFuncPropagation(t *testing.T) {
func TestFlagOnPflagCommandLine(t *testing.T) {
flagName := "flagOnCommandLine"
pflag.CommandLine.String(flagName, "", "about my flag")
pflag.String(flagName, "", "about my flag")
r := fullSetupTest("--help")
checkResultContains(t, r, flagName)
// reset CommandLine flagset
// Reset pflag.CommandLine flagset.
pflag.CommandLine = pflag.NewFlagSet(os.Args[0], pflag.ExitOnError)
}