github.com/argoproj/argo-events@v1.9.1/cmd/commands/root.go (about)

     1  package commands
     2  
     3  import (
     4  	"fmt"
     5  	"os"
     6  
     7  	"github.com/spf13/cobra"
     8  )
     9  
    10  var rootCmd = &cobra.Command{
    11  	Use:   "argo-events",
    12  	Short: "Argo Events CLI",
    13  	Run: func(cmd *cobra.Command, args []string) {
    14  		cmd.HelpFunc()(cmd, args)
    15  	},
    16  }
    17  
    18  func Execute() {
    19  	if err := rootCmd.Execute(); err != nil {
    20  		fmt.Println(err)
    21  		os.Exit(1)
    22  	}
    23  }
    24  
    25  func init() {
    26  	rootCmd.AddCommand(NewControllerCommand())
    27  	rootCmd.AddCommand(NewEventSourceCommand())
    28  	rootCmd.AddCommand(NewSensorCommand())
    29  	rootCmd.AddCommand(NewWebhookCommand())
    30  }