diff --git a/cmd/restic/cmd_snapshots.go b/cmd/restic/cmd_snapshots.go index dbf5d3478..12795201a 100644 --- a/cmd/restic/cmd_snapshots.go +++ b/cmd/restic/cmd_snapshots.go @@ -172,7 +172,8 @@ func PrintSnapshots(stdout io.Writer, list restic.Snapshots, compact bool) { type Snapshot struct { *restic.Snapshot - ID *restic.ID `json:"id"` + ID *restic.ID `json:"id"` + ShortID string `json:"short_id"` } // printSnapshotsJSON writes the JSON representation of list to stdout. @@ -185,6 +186,7 @@ func printSnapshotsJSON(stdout io.Writer, list restic.Snapshots) error { k := Snapshot{ Snapshot: sn, ID: sn.ID(), + ShortID: sn.ID().Str(), } snapshots = append(snapshots, k) }