diff --git a/cli/reporter/json.go b/cli/reporter/json.go index e63d9b57..ec7bec96 100644 --- a/cli/reporter/json.go +++ b/cli/reporter/json.go @@ -51,7 +51,7 @@ func prepareAssetsForPrinting(assets map[string]*inventory.Asset) map[string]*as Mrn: a.Mrn, Name: a.Name, Url: a.Url, - PlatformName: getPlatforNameForAsset(a), + PlatformName: getPlatformNameForAsset(a), } printableAssets[k] = pAsset } diff --git a/cli/reporter/print.go b/cli/reporter/print.go index a175858f..d2a1dca3 100644 --- a/cli/reporter/print.go +++ b/cli/reporter/print.go @@ -69,7 +69,7 @@ func (r *Reporter) scoreColored(rating policy.ScoreRating, s string) string { return s } -func getPlatforNameForAsset(asset *inventory.Asset) string { +func getPlatformNameForAsset(asset *inventory.Asset) string { platformName := "" if asset.Platform != nil { if asset.Platform.Title == "" { diff --git a/cli/reporter/print_compact.go b/cli/reporter/print_compact.go index 6ab1fe8d..4a178ede 100644 --- a/cli/reporter/print_compact.go +++ b/cli/reporter/print_compact.go @@ -90,7 +90,7 @@ func (r *defaultReporter) printSummary(orderedAssets []assetMrnName) { if val, ok := asset.Labels["mondoo.com/project-id"]; ok { projectId = val } - platformName := getPlatforNameForAsset(asset) + platformName := getPlatformNameForAsset(asset) if platformName != "" { assetsByPlatform[platformName] = append(assetsByPlatform[platformName], asset) } @@ -105,7 +105,11 @@ func (r *defaultReporter) printSummary(orderedAssets []assetMrnName) { } if len(assetsByScore) > 0 { - header := fmt.Sprintf("Scanned %d assets", len(r.data.Assets)) + assetsString := "asset" + if len(r.data.Assets) > 1 { + assetsString = "assets" + } + header := fmt.Sprintf("Scanned %d %s", len(r.data.Assets), assetsString) r.out.Write([]byte(termenv.String(header + NewLineCharacter).Foreground(r.Colors.Primary).String())) }