forked from TrueCloudLab/restic
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:
parent
449c049ce9
commit
d19a29f79e
1 changed files with 8 additions and 5 deletions
|
@ -236,6 +236,8 @@ func runForget(opts ForgetOptions, gopts GlobalOptions, args []string) error {
|
||||||
}
|
}
|
||||||
addJSONSnapshots(&fg.Remove, remove)
|
addJSONSnapshots(&fg.Remove, remove)
|
||||||
|
|
||||||
|
fg.Reasons = reasons
|
||||||
|
|
||||||
jsonGroups = append(jsonGroups, &fg)
|
jsonGroups = append(jsonGroups, &fg)
|
||||||
|
|
||||||
removeSnapshots += len(remove)
|
removeSnapshots += len(remove)
|
||||||
|
@ -276,6 +278,7 @@ type ForgetGroup struct {
|
||||||
Paths []string `json:"paths"`
|
Paths []string `json:"paths"`
|
||||||
Keep []Snapshot `json:"keep"`
|
Keep []Snapshot `json:"keep"`
|
||||||
Remove []Snapshot `json:"remove"`
|
Remove []Snapshot `json:"remove"`
|
||||||
|
Reasons []restic.KeepReason `json:"reasons"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func addJSONSnapshots(js *[]Snapshot, list restic.Snapshots) {
|
func addJSONSnapshots(js *[]Snapshot, list restic.Snapshots) {
|
||||||
|
|
Loading…
Reference in a new issue