2021-06-24 09:28:44 +00:00
|
|
|
package cmd
|
|
|
|
|
|
|
|
import (
|
|
|
|
cli "github.com/qiniu/goc/v2/pkg/watch"
|
|
|
|
"github.com/spf13/cobra"
|
|
|
|
)
|
|
|
|
|
|
|
|
var watchCmd = &cobra.Command{
|
|
|
|
Use: "watch",
|
|
|
|
Short: "watch for profile's real time update",
|
|
|
|
Long: "watch for profile's real time update",
|
|
|
|
Example: "",
|
|
|
|
|
|
|
|
Run: watch,
|
|
|
|
}
|
|
|
|
|
2021-09-02 06:36:41 +00:00
|
|
|
var (
|
|
|
|
watchHost string
|
|
|
|
)
|
|
|
|
|
2021-06-24 09:28:44 +00:00
|
|
|
func init() {
|
2021-09-02 06:36:41 +00:00
|
|
|
watchCmd.Flags().StringVarP(&watchHost, "host", "", "127.0.0.1:7777", "specify the host of the goc server")
|
2021-06-24 09:28:44 +00:00
|
|
|
rootCmd.AddCommand(watchCmd)
|
|
|
|
}
|
|
|
|
|
|
|
|
func watch(cmd *cobra.Command, args []string) {
|
2021-09-02 06:36:41 +00:00
|
|
|
cli.Watch(watchHost)
|
2021-06-24 09:28:44 +00:00
|
|
|
}
|