INNER CODE UNIT · Go
init
controlplaneio/kubesec · cmd/print-rules.go:15
func init() {
var format string
var printRulesCmd = &cobra.Command{
Use: `print-rules`,
Short: "Print all the scanning rules with their associated scores",
Example: ` kubesec print-rules
kubesec print-rules -f yaml
kubesec print-rules -f table`,
}
printRulesCmd.Flags().StringVarP(&format, "format", "f", "json", "Set output format (json, yaml, table)")
printRulesCmd.RunE = func(cmd *cobra.Command, args []string) error {
rootCmd.SilenceErrors = true
rootCmd.SilenceUsage = true
ruleSet, err := ruler.NewRuleset(logger)
if err != nil {
return err