func init()

in cmd/psa-checker/root.go [64:84]


func init() {
	cobra.OnInitialize(initConfig)

	// Here you will define your flags and configuration settings.
	// Cobra supports persistent flags, which, if defined here,
	// will be global for your application.

	rootCmd.PersistentFlags().StringVar(&cfgFile, "config", "", "config file (default is $HOME/.test.yaml)")

	// Cobra local flags, which will only run when this action is called directly.

	rootCmd.Flags().StringP("filename", "f", "", "Name of the file to test")
	rootCmd.Flags().StringP("level", "l", "baseline", "Pod Security Standard level to test")
	// rootCmd.Flags().BoolP("break", "b", false, "Break on first error")

	viper.BindPFlag("filename", rootCmd.Flags().Lookup("filename"))
	viper.BindPFlag("level", rootCmd.Flags().Lookup("level"))

	// rootCmd.MarkFlagRequired("filename")

}