mirror of
https://github.com/restic/restic.git
synced 2025-12-11 18:47:50 +00:00
ui: restore --delete indicates number of deleted files (#5100)
* ui: restore --delete indicates number of deleted files * adds new field `FilesDeleted` to the State struct, JSON and text progress updaters * increment FilesDeleted count when ReportedDeletedFile * ui: collect the files to be deleted, delete, then update the count post deletion * docs: update scripting output fields for restore command ui: report deleted directories and refactor function name to ReportDeletion
This commit is contained in:
@@ -30,6 +30,9 @@ func (t *textPrinter) Update(p State, duration time.Duration) {
|
||||
if p.FilesSkipped > 0 {
|
||||
progress += fmt.Sprintf(", skipped %v files/dirs %v", p.FilesSkipped, ui.FormatBytes(p.AllBytesSkipped))
|
||||
}
|
||||
if p.FilesDeleted > 0 {
|
||||
progress += fmt.Sprintf(", deleted %v files/dirs", p.FilesDeleted)
|
||||
}
|
||||
|
||||
t.terminal.SetStatus([]string{progress})
|
||||
}
|
||||
@@ -82,6 +85,9 @@ func (t *textPrinter) Finish(p State, duration time.Duration) {
|
||||
if p.FilesSkipped > 0 {
|
||||
summary += fmt.Sprintf(", skipped %v files/dirs %v", p.FilesSkipped, ui.FormatBytes(p.AllBytesSkipped))
|
||||
}
|
||||
if p.FilesDeleted > 0 {
|
||||
summary += fmt.Sprintf(", deleted %v files/dirs", p.FilesDeleted)
|
||||
}
|
||||
|
||||
t.terminal.Print(summary)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user