diff --git a/cmd/osv-scanner/__snapshots__/main_test.snap b/cmd/osv-scanner/__snapshots__/main_test.snap index 1db8977ca4..b9fdcc4925 100755 --- a/cmd/osv-scanner/__snapshots__/main_test.snap +++ b/cmd/osv-scanner/__snapshots__/main_test.snap @@ -1150,6 +1150,7 @@ failed to pull container image: failed to run docker command Checking if docker image ("alpine:3.18.9") exists locally... Saving docker image ("alpine:3.18.9") to temporary file... Scanning image "alpine:3.18.9" + Container Scanning Result (Alpine Linux v3.18): Total 1 packages affected by 1 vulnerabilities (0 Critical, 0 High, 0 Medium, 0 Low, 1 Unknown) from 1 ecosystems. 1 vulnerabilities have fixes available. @@ -1163,8 +1164,8 @@ Alpine:v3.18 | openssl | 3.1.7-r0 | Fix Available | 1 | # 0 Layer | alpine | +---------+-------------------+---------------+------------+------------------+---------------+ -For the most comprehensive scan results, we recommend using the HTML output: `osv-scanner --format html --output results.html`. -You can also view the full vulnerability list in your terminal with: `osv-scanner --format vertical`. +For the most comprehensive scan results, we recommend using the HTML output: `osv-scanner scan image --serve `. +You can also view the full vulnerability list in your terminal with: `osv-scanner scan image --format vertical `. --- diff --git a/internal/output/table.go b/internal/output/table.go index 43046c1a0b..e61b26d991 100644 --- a/internal/output/table.go +++ b/internal/output/table.go @@ -100,6 +100,8 @@ func tableBuilder(outputTable table.Writer, vulnResult *models.VulnerabilityResu } func printContainerScanningResult(result Result, outputWriter io.Writer, terminalWidth int) { + // Add a newline to separate results from logs. + fmt.Fprintln(outputWriter) fmt.Fprintf(outputWriter, "Container Scanning Result (%s):\n", result.ImageInfo.OS) summary := fmt.Sprintf( "Total %[1]d packages affected by %[2]d vulnerabilities (%[3]d Critical, %[4]d High, %[5]d Medium, %[6]d Low, %[7]d Unknown) from %[8]d ecosystems.\n"+