From f980f5647e55993c52b9c22c58c6af188c29e6bf Mon Sep 17 00:00:00 2001 From: Michael Eischer Date: Mon, 8 Jul 2024 19:58:11 +0200 Subject: [PATCH] snapshots: also show snapshot size in compact view --- changelog/unreleased/issue-693 | 1 + cmd/restic/cmd_snapshots.go | 3 +++ 2 files changed, 4 insertions(+) diff --git a/changelog/unreleased/issue-693 b/changelog/unreleased/issue-693 index 054ae42ed..34b5b9455 100644 --- a/changelog/unreleased/issue-693 +++ b/changelog/unreleased/issue-693 @@ -10,3 +10,4 @@ statistics use `restic snapshots --json` or `restic cat snapshot `. https://github.com/restic/restic/issues/693 https://github.com/restic/restic/pull/4705 +https://github.com/restic/restic/pull/4913 diff --git a/cmd/restic/cmd_snapshots.go b/cmd/restic/cmd_snapshots.go index f689e4260..ea15af019 100644 --- a/cmd/restic/cmd_snapshots.go +++ b/cmd/restic/cmd_snapshots.go @@ -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 }}")