2
2
mirror of https://github.com/octoleo/restic.git synced 2024-12-26 20:30:19 +00:00

Merge pull request #4913 from MichaelEischer/always-show-snapshot-size

snapshots: also show snapshot size in compact view
This commit is contained in:
Michael Eischer 2024-07-10 20:05:41 +02:00 committed by GitHub
commit 7cea5402ff
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 0 deletions

View File

@ -10,3 +10,4 @@ statistics use `restic snapshots --json` or `restic cat snapshot <snapshotID>`.
https://github.com/restic/restic/issues/693 https://github.com/restic/restic/issues/693
https://github.com/restic/restic/pull/4705 https://github.com/restic/restic/pull/4705
https://github.com/restic/restic/pull/4913

View File

@ -190,6 +190,9 @@ func PrintSnapshots(stdout io.Writer, list restic.Snapshots, reasons []restic.Ke
tab.AddColumn("Time", "{{ .Timestamp }}") tab.AddColumn("Time", "{{ .Timestamp }}")
tab.AddColumn("Host", "{{ .Hostname }}") tab.AddColumn("Host", "{{ .Hostname }}")
tab.AddColumn("Tags ", `{{ join .Tags "\n" }}`) tab.AddColumn("Tags ", `{{ join .Tags "\n" }}`)
if hasSize {
tab.AddColumn("Size", `{{ .Size }}`)
}
} else { } else {
tab.AddColumn("ID", "{{ .ID }}") tab.AddColumn("ID", "{{ .ID }}")
tab.AddColumn("Time", "{{ .Timestamp }}") tab.AddColumn("Time", "{{ .Timestamp }}")