root.go 528 B

12345678910111213141516171819202122232425262728
  1. package cmd
  2. import (
  3. "os"
  4. "github.com/spf13/cobra"
  5. )
  6. var RootCmd = &cobra.Command{
  7. Use: "kpt-pasture",
  8. Short: "科湃腾牛群系统",
  9. }
  10. // Execute adds all child commands to the root command and sets flags appropriately.
  11. // This is called by main.main(). It only needs to happen once to the rootCmd.
  12. func Execute() {
  13. err := RootCmd.Execute()
  14. if err != nil {
  15. os.Exit(1)
  16. }
  17. }
  18. func init() {
  19. RootCmd.AddCommand(httpCmd)
  20. RootCmd.AddCommand(JobCmd)
  21. RootCmd.AddCommand(CrontabCmd)
  22. RootCmd.AddCommand(ConsumerCmd)
  23. }