snapshots: also show snapshot size in compact view

This commit is contained in:
Michael Eischer 2024-07-08 19:58:11 +02:00
parent b71a885b92
commit f980f5647e
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/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("Host", "{{ .Hostname }}")
tab.AddColumn("Tags ", `{{ join .Tags "\n" }}`)
if hasSize {
tab.AddColumn("Size", `{{ .Size }}`)
}
} else {
tab.AddColumn("ID", "{{ .ID }}")
tab.AddColumn("Time", "{{ .Timestamp }}")