vulsio / go-cve-dictionary

Build a local copy of CVE (NVD and Japanese JVN). Server mode for easy querying.
Apache License 2.0
367 stars 109 forks source link

chore(command): --without-jvncert flag limited to jvn command #337

Closed MaineK00n closed 1 year ago

MaineK00n commented 1 year ago

What did you implement:

--without-jvncert added by #335 is a flag that can only be used with JVN command. Therefore, it should be a flag limited to JVN command.

Type of change

How Has This Been Tested?

before

$ go-cve-dictionary fetch -h
Fetch Vulnerability dictionary

Usage:
  go-cve-dictionary fetch [command]

Available Commands:
  fortinet    Fetch Vulnerability dictionary from Fortinet Advisories
  jvn         Fetch Vulnerability dictionary from JVN
  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).

Global Flags:
...

after

$ go-cve-dictionary fetch -h
Fetch Vulnerability dictionary

Usage:
  go-cve-dictionary fetch [command]

Available Commands:
  fortinet    Fetch Vulnerability dictionary from Fortinet Advisories
  jvn         Fetch Vulnerability dictionary from JVN
  nvd         Fetch Vulnerability dictionary from NVD

Flags:
      --batch-size int   The number of batch size to insert. (default 5)
  -h, --help             help for fetch

Global Flags:
...

$ go-cve-dictionary fetch jvn -h
Fetch Vulnerability dictionary from JVN

Usage:
  go-cve-dictionary fetch jvn [flags]

Flags:
  -h, --help              help for jvn
      --without-jvncert   not request to jvn cert.

Global Flags:
      --batch-size int      The number of batch size to insert. (default 5)
...

$ go-cve-dictionary fetch jvn --without-jvncert
...
INFO[09-25|15:48:06] Inserting fetched CVEs(2023)... 
2998 / 2998 [-------------------------------------------------] 100.00% 4054 p/s
INFO[09-25|15:48:07] Refreshed 2998 CVEs. 
INFO[09-25|15:48:08] Finished fetching JVN. 

Checklist:

You don't have to satisfy all of the following.

Is this ready for review?: YES

Reference