INNER CODE UNIT · Go

init

FairwindsOps/rbac-lookup · cmd/root.go:52

func init() {
	rootCmd.PersistentFlags().StringVarP(&outputFormat, "output", "o", "", "output format (normal, wide)")
	rootCmd.PersistentFlags().StringVarP(&kubeConfig, "kubeconfig", "", "", "config file location")
	rootCmd.PersistentFlags().StringVarP(&kubeContext, "context", "", "", "context to use for Kubernetes config")
	rootCmd.PersistentFlags().StringVarP(&subjectKind, "kind", "k", "", "filter by this RBAC subject kind (user, group, serviceaccount)")
	rootCmd.PersistentFlags().BoolVar(&enableGke, "gke", false, "enable GKE integration")
}

// Execute is the primary entrypoint for this CLI
func Execute(VERSION string, COMMIT string) {
	version = VERSION
	commit = COMMIT
	if err := rootCmd.Execute(); err != nil {
		fmt.Println(err)
		os.Exit(1)
	}
}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…