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:
@@ -11,6 +11,7 @@ type State struct {
|
||||
FilesFinished uint64
|
||||
FilesTotal uint64
|
||||
FilesSkipped uint64
|
||||
FilesDeleted uint64
|
||||
AllBytesWritten uint64
|
||||
AllBytesTotal uint64
|
||||
AllBytesSkipped uint64
|
||||
@@ -124,11 +125,13 @@ func (p *Progress) AddSkippedFile(name string, size uint64) {
|
||||
p.printer.CompleteItem(ActionFileUnchanged, name, size)
|
||||
}
|
||||
|
||||
func (p *Progress) ReportDeletedFile(name string) {
|
||||
func (p *Progress) ReportDeletion(name string) {
|
||||
if p == nil {
|
||||
return
|
||||
}
|
||||
|
||||
p.s.FilesDeleted++
|
||||
|
||||
p.m.Lock()
|
||||
defer p.m.Unlock()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user