From 2d89311d49afbe23730dc066c2eed2ec64be46c4 Mon Sep 17 00:00:00 2001 From: Matthew Holt Date: Fri, 17 Aug 2018 17:15:30 -0600 Subject: [PATCH] stats: Show what was scanned and scanning mode used --- cmd/restic/cmd_stats.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/cmd/restic/cmd_stats.go b/cmd/restic/cmd_stats.go index a1281e998..79ca8e02a 100644 --- a/cmd/restic/cmd_stats.go +++ b/cmd/restic/cmd_stats.go @@ -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) }