Skip to content

Commit

Permalink
Merge pull request #9614 from prezha/fix-help-flag
Browse files Browse the repository at this point in the history
fix help flag 'pflag: help requested' error
  • Loading branch information
priyawadhwa authored Nov 6, 2020
2 parents ffaa39a + 7d99c66 commit ac898f8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cmd/minikube/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,8 @@ func setFlags() {
// "Flag parsing stops just before the first non-flag argument" (ref: https://pkg.go.dev/flag#hdr-Command_line_flag_syntax)
pflag.CommandLine.ParseErrorsWhitelist.UnknownFlags = true
pflag.CommandLine.AddGoFlagSet(flag.CommandLine)
// avoid 'pflag: help requested' error, as help will be defined later by cobra cmd.Execute()
pflag.BoolP("help", "h", false, "")
pflag.Parse()

// set default flag value for logtostderr and alsologtostderr but don't override user's preferences
Expand Down

0 comments on commit ac898f8

Please sign in to comment.