Merge pull request #1961 from mholt/statsoutput

stats: Show what was scanned and scanning mode used
This commit is contained in:
Alexander Neumann 2018-08-18 14:29:14 +02:00
commit 401a564486
1 changed files with 13 additions and 0 deletions

View File

@ -81,6 +81,10 @@ func runStats(gopts GlobalOptions, args []string) error {
} }
} }
if !gopts.JSON {
Printf("scanning...\n")
}
// create a container for the stats (and other needed state) // create a container for the stats (and other needed state)
stats := &statsContainer{ stats := &statsContainer{
uniqueFiles: make(map[fileID]struct{}), uniqueFiles: make(map[fileID]struct{}),
@ -145,6 +149,15 @@ func runStats(gopts GlobalOptions, args []string) error {
return nil return nil
} }
// inform the user what was scanned and how it was scanned
snapshotsScanned := snapshotIDString
if snapshotsScanned == "latest" {
snapshotsScanned = "the latest snapshot"
} else if snapshotsScanned == "" {
snapshotsScanned = "all snapshots"
}
Printf("Stats for %s in %s mode:\n", snapshotsScanned, countMode)
if stats.TotalBlobCount > 0 { if stats.TotalBlobCount > 0 {
Printf(" Total Blob Count: %d\n", stats.TotalBlobCount) Printf(" Total Blob Count: %d\n", stats.TotalBlobCount)
} }