Skip to content

Commit ac898f8

Browse files
author
priyawadhwa
authored
Merge pull request #9614 from prezha/fix-help-flag
fix help flag 'pflag: help requested' error
2 parents ffaa39a + 7d99c66 commit ac898f8

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

cmd/minikube/main.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,8 @@ func setFlags() {
127127
// "Flag parsing stops just before the first non-flag argument" (ref: https://pkg.go.dev/flag#hdr-Command_line_flag_syntax)
128128
pflag.CommandLine.ParseErrorsWhitelist.UnknownFlags = true
129129
pflag.CommandLine.AddGoFlagSet(flag.CommandLine)
130+
// avoid 'pflag: help requested' error, as help will be defined later by cobra cmd.Execute()
131+
pflag.BoolP("help", "h", false, "")
130132
pflag.Parse()
131133

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

0 commit comments

Comments
 (0)