package cmd

import (
	"github.com/tidbcloud/topsql-agent/internal/supervisor"

	"github.com/spf13/cobra"
)

var (
	metricsAddress string
)

// supervisorCmd represents the supervisor command
var supervisorCmd = &cobra.Command{
	Use:   "supervisor",
	Short: "Top SQL agent supervisor",
	Long: `This program launches the Top SQL agent as a child process, and exports prometheus metrics
	for the up state of the agent process.`,
	Run: func(cmd *cobra.Command, args []string) {
		supervisor.Run(metricsAddress, cmd.Flags())
	},
}

func init() {
	rootCmd.AddCommand(supervisorCmd)
}
