2
2
mirror of https://github.com/octoleo/restic.git synced 2024-06-04 18:10:50 +00:00

Include reasons in json output of forget

This dumps the reasons as well as the list of keeps and removes with the
output from the forget command.
This commit is contained in:
David Brown 2019-02-23 09:38:33 -07:00
parent 449c049ce9
commit d19a29f79e

View File

@ -236,6 +236,8 @@ func runForget(opts ForgetOptions, gopts GlobalOptions, args []string) error {
}
addJSONSnapshots(&fg.Remove, remove)
fg.Reasons = reasons
jsonGroups = append(jsonGroups, &fg)
removeSnapshots += len(remove)
@ -276,6 +278,7 @@ type ForgetGroup struct {
Paths []string `json:"paths"`
Keep []Snapshot `json:"keep"`
Remove []Snapshot `json:"remove"`
Reasons []restic.KeepReason `json:"reasons"`
}
func addJSONSnapshots(js *[]Snapshot, list restic.Snapshots) {