diff --git a/README.md b/README.md index 5a8b5b9..8c223a7 100644 --- a/README.md +++ b/README.md @@ -247,13 +247,12 @@ Available Commands: nvd Fetch Vulnerability dictionary from NVD Flags: - --batch-size int The number of batch size to insert. (default 5) - -h, --help help for fetch - --without-jvncert not request to jvn cert (only jvn). + --batch-size int The number of batch size to insert. (default 5) + -h, --help help for fetch Global Flags: --config string config file (default is $HOME/.go-cve-dictionary.yaml) - --dbpath string /path/to/sqlite3 or SQL connection string (default "/go-cve-dictionary/cve.sqlite3") + --dbpath string /path/to/sqlite3 or SQL connection string (default "$PWD/cve.sqlite3") --dbtype string Database type to store data in (sqlite3, mysql, postgres or redis supported) (default "sqlite3") --debug debug mode (default: false) --debug-sql SQL debug mode diff --git a/commands/fetch.go b/commands/fetch.go index f6affcc..c9ea3b4 100644 --- a/commands/fetch.go +++ b/commands/fetch.go @@ -16,7 +16,4 @@ func init() { fetchCmd.PersistentFlags().Int("batch-size", 5, "The number of batch size to insert.") _ = viper.BindPFlag("batch-size", fetchCmd.PersistentFlags().Lookup("batch-size")) - - fetchCmd.PersistentFlags().Bool("without-jvncert", false, "not request to jvn cert (only jvn).") - _ = viper.BindPFlag("without-jvncert", fetchCmd.PersistentFlags().Lookup("without-jvncert")) } diff --git a/commands/fetchjvn.go b/commands/fetchjvn.go index aba0ea5..aac6cf3 100644 --- a/commands/fetchjvn.go +++ b/commands/fetchjvn.go @@ -5,10 +5,11 @@ import ( "github.com/spf13/cobra" "github.com/spf13/viper" + "golang.org/x/xerrors" + db "github.com/vulsio/go-cve-dictionary/db" log "github.com/vulsio/go-cve-dictionary/log" "github.com/vulsio/go-cve-dictionary/models" - "golang.org/x/xerrors" ) var fetchJvnCmd = &cobra.Command{ @@ -20,6 +21,9 @@ var fetchJvnCmd = &cobra.Command{ func init() { fetchCmd.AddCommand(fetchJvnCmd) + + fetchJvnCmd.PersistentFlags().Bool("without-jvncert", false, "not request to jvn cert.") + _ = viper.BindPFlag("without-jvncert", fetchJvnCmd.PersistentFlags().Lookup("without-jvncert")) } func fetchJvn(_ *cobra.Command, args []string) (err error) {