Undisplay the number of CVEs at the end of 'scan --package-list-only'

This commit is contained in:
kota kanbe
2017-07-25 20:55:54 +09:00
parent 26e447f11a
commit 1aae425945
6 changed files with 17 additions and 11 deletions

View File

@@ -43,10 +43,16 @@ func formatScanSummary(rs ...models.ScanResult) string {
for _, r := range rs {
var cols []interface{}
if len(r.Errors) == 0 {
var cves string
if config.Conf.PackageListOnly {
cves = fmt.Sprintf("- CVEs")
} else {
cves = fmt.Sprintf("%d CVEs", len(r.ScannedCves))
}
cols = []interface{}{
r.FormatServerName(),
fmt.Sprintf("%s%s", r.Family, r.Release),
fmt.Sprintf("%d CVEs", len(r.ScannedCves)),
cves,
r.Packages.FormatUpdatablePacksSummary(),
}
} else {