INNER CODE UNIT · Go
main
rabbitmq/cluster-operator · kubectl-rabbitmq/main.go:22
func main() {
var namespace string
var allNamespaces bool
rootCmd := &cobra.Command{
Use: "kubectl-rabbitmq",
Short: "kubectl plugin for managing RabbitMQ clusters",
Long: `kubectl-rabbitmq is a kubectl plugin for managing RabbitMQ clusters.
It provides commands to create, list, manage, and debug RabbitMQ clusters running on Kubernetes.`,
SilenceUsage: true,
SilenceErrors: false,
}
// Global flags
rootCmd.PersistentFlags().StringVarP(&namespace, "namespace", "n", "", "Kubernetes namespace")
rootCmd.PersistentFlags().BoolVarP(&allNamespaces, "all-namespaces", "A", false, "List resources across all namespaces")
// Create a function to get the executor based on current flag values