silence usage when pass bad cmd options

This commit is contained in:
Sally O'Malley 2019-12-28 10:43:33 -05:00
parent 623b697886
commit 35dea07ad6
No known key found for this signature in database
GPG Key ID: 9AD4DAB10C905B8C

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