root.go 490 B

1234567891011121314151617181920212223242526272829
  1. /*
  2. Copyright © 2022 NAME HERE <EMAIL ADDRESS>
  3. */
  4. package cmd
  5. import (
  6. "os"
  7. "github.com/spf13/cobra"
  8. )
  9. var RootCmd = &cobra.Command{
  10. Use: "kpt-event",
  11. Short: "自定义事件驱动系统",
  12. }
  13. // Execute adds all child commands to the root command and sets flags appropriately.
  14. // This is called by main.main(). It only needs to happen once to the rootCmd.
  15. func Execute() {
  16. err := RootCmd.Execute()
  17. if err != nil {
  18. os.Exit(1)
  19. }
  20. }
  21. func init() {
  22. RootCmd.AddCommand(httpCmd)
  23. }