Skip to content

Commit

Permalink
chore(command): --without-jvncert flag limited to jvn command (#337)
Browse files Browse the repository at this point in the history
  • Loading branch information
MaineK00n authored Sep 25, 2023
1 parent 553ed5d commit 66e5573
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 0 additions & 3 deletions commands/fetch.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
}
6 changes: 5 additions & 1 deletion commands/fetchjvn.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand All @@ -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) {
Expand Down

0 comments on commit 66e5573

Please sign in to comment.