mirror of
https://github.com/restic/restic.git
synced 2024-12-23 08:16:36 +00:00
Merge pull request #1961 from mholt/statsoutput
stats: Show what was scanned and scanning mode used
This commit is contained in:
commit
401a564486
1 changed files with 13 additions and 0 deletions
|
@ -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)
|
||||
stats := &statsContainer{
|
||||
uniqueFiles: make(map[fileID]struct{}),
|
||||
|
@ -145,6 +149,15 @@ func runStats(gopts GlobalOptions, args []string) error {
|
|||
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 {
|
||||
Printf(" Total Blob Count: %d\n", stats.TotalBlobCount)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue