From 8eb193a6c1ecbefec56c28365ba24aa13dd60450 Mon Sep 17 00:00:00 2001 From: Sally O'Malley Date: Sat, 28 Dec 2019 10:43:33 -0500 Subject: [PATCH] silence usage when pass bad cmd options Kubernetes-commit: 35dea07ad6d17ce6b7185621753cce468c8cbc97 --- pkg/util/templates/templater.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/util/templates/templater.go b/pkg/util/templates/templater.go index 18901348a..c8036ac13 100644 --- a/pkg/util/templates/templater.go +++ b/pkg/util/templates/templater.go @@ -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