silence usage when pass bad cmd options

Kubernetes-commit: 35dea07ad6d17ce6b7185621753cce468c8cbc97
This commit is contained in:
Sally O'Malley 2019-12-28 10:43:33 -05:00 committed by Kubernetes Publisher
parent 5faa920af5
commit 8eb193a6c1
1 changed files with 1 additions and 0 deletions

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