root.go 577 B

1234567891011121314151617181920212223242526272829
  1. /*
  2. Copyright © 2024 NAME HERE <EMAIL ADDRESS>
  3. */
  4. package cmd
  5. import (
  6. "os"
  7. "github.com/spf13/cobra"
  8. )
  9. // rootCmd represents the base command when called without any subcommands
  10. var rootCmd = &cobra.Command{
  11. Use: "kpt-temporary-mqtt",
  12. Short: "科派腾临时订阅mqtt消息",
  13. }
  14. // Execute adds all child commands to the root command and sets flags appropriately.
  15. // This is called by main.main(). It only needs to happen once to the rootCmd.
  16. func Execute() {
  17. err := rootCmd.Execute()
  18. if err != nil {
  19. os.Exit(1)
  20. }
  21. }
  22. func init() {
  23. rootCmd.AddCommand(mqttCmd)
  24. }