File: fetch.go

package info (click to toggle)
gost 0.1.2-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,608 kB
  • sloc: makefile: 2
file content (25 lines) | stat: -rw-r--r-- 681 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package cmd

import (
	"github.com/spf13/cobra"
	"github.com/spf13/viper"
)

// fetchCmd represents the fetch command
var fetchCmd = &cobra.Command{
	Use:   "fetch",
	Short: "Fetch the data of the security tracker",
	Long:  `Fetch the data of the security tracker`,
}

func init() {
	RootCmd.AddCommand(fetchCmd)

	fetchCmd.PersistentFlags().Int("wait", 0, "Interval between fetch (seconds)")
	viper.BindPFlag("wait", fetchCmd.PersistentFlags().Lookup("wait"))
	viper.SetDefault("wait", 0)

	fetchCmd.PersistentFlags().Int("threads", 5, "The number of threads to be used")
	viper.BindPFlag("threads", fetchCmd.PersistentFlags().Lookup("threads"))
	viper.SetDefault("threads", 5)
}