goc/cmd/watch.go

29 lines
528 B
Go
Raw Normal View History

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,
}
var (
watchHost string
)
2021-06-24 09:28:44 +00:00
func init() {
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) {
cli.Watch(watchHost)
2021-06-24 09:28:44 +00:00
}