From 7d99c66efac60df16b504d604330edebce4b1b38 Mon Sep 17 00:00:00 2001 From: Predrag Rogic Date: Fri, 6 Nov 2020 02:42:52 +0000 Subject: [PATCH] fix help flag 'pflag: help requested' error --- cmd/minikube/main.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cmd/minikube/main.go b/cmd/minikube/main.go index 719e2ffa47f4..648a2656548c 100644 --- a/cmd/minikube/main.go +++ b/cmd/minikube/main.go @@ -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