forked from TrueCloudLab/restic
Merge pull request #1320 from restic/add-snapshots-json-short-id
snapshots: Add short ID to JSON output
This commit is contained in:
commit
79f63a2e74
1 changed files with 3 additions and 1 deletions
|
@ -173,6 +173,7 @@ type Snapshot struct {
|
||||||
*restic.Snapshot
|
*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.
|
// printSnapshotsJSON writes the JSON representation of list to stdout.
|
||||||
|
@ -185,6 +186,7 @@ func printSnapshotsJSON(stdout io.Writer, list restic.Snapshots) error {
|
||||||
k := Snapshot{
|
k := Snapshot{
|
||||||
Snapshot: sn,
|
Snapshot: sn,
|
||||||
ID: sn.ID(),
|
ID: sn.ID(),
|
||||||
|
ShortID: sn.ID().Str(),
|
||||||
}
|
}
|
||||||
snapshots = append(snapshots, k)
|
snapshots = append(snapshots, k)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue