Merge pull request #86693 from sallyom/silence-usage-on-error

silence usage when required flag is not passed
This commit is contained in:
Kubernetes Prow Robot 2020-01-02 08:47:40 -08:00 committed by GitHub
commit c72d5fd255
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -45,6 +45,7 @@ func ActsAsRootCommand(cmd *cobra.Command, filters []string, groups ...CommandGr
Filtered: filters,
}
cmd.SetFlagErrorFunc(templater.FlagErrorFunc())
cmd.SilenceUsage = true
cmd.SetUsageFunc(templater.UsageFunc())
cmd.SetHelpFunc(templater.HelpFunc())
return templater