2020-07-18 14:18:54 +08:00
|
|
|
package cmd
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/zu1k/nali/internal/app"
|
|
|
|
|
|
|
|
"github.com/spf13/cobra"
|
|
|
|
)
|
|
|
|
|
|
|
|
// cdnCmd represents the cdn command
|
|
|
|
var cdnCmd = &cobra.Command{
|
|
|
|
Use: "cdn",
|
|
|
|
Short: "Query cdn service provider",
|
|
|
|
Long: `Query cdn service provider`,
|
|
|
|
Run: func(cmd *cobra.Command, args []string) {
|
|
|
|
if update {
|
|
|
|
app.UpdateDB()
|
|
|
|
}
|
|
|
|
|
|
|
|
app.InitCDNDB()
|
2020-08-10 13:01:43 +08:00
|
|
|
app.CDN(args)
|
2020-07-18 14:18:54 +08:00
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
var (
|
|
|
|
update = false
|
|
|
|
)
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
rootCmd.AddCommand(cdnCmd)
|
|
|
|
cdnCmd.Flags().BoolVarP(&update, "update", "u", false, "Update CDN database")
|
|
|
|
}
|