Merge pull request #7292 from linkvt/fix-missing-global-options

Show all global flags in options command
pull/7295/head
Medya Ghazizadeh 2020-03-27 22:13:07 -07:00 committed by GitHub
commit 801d49afd0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 4 deletions

View File

@ -37,10 +37,9 @@ var optionsCmd = &cobra.Command{
// runOptions handles the executes the flow of "minikube options"
func runOptions(cmd *cobra.Command, args []string) {
out.String("The following options can be passed to any command:\n\n")
for _, flagName := range viperWhiteList {
f := pflag.Lookup(flagName)
out.String(flagUsage(f))
}
cmd.Root().PersistentFlags().VisitAll(func(flag *pflag.Flag) {
out.String(flagUsage(flag))
})
}
func flagUsage(flag *pflag.Flag) string {