mirror of
https://github.com/restic/restic.git
synced 2026-05-13 14:05:24 +00:00
ui: move SetDryRun to ProgressReporter
This commit is contained in:
@@ -20,7 +20,6 @@ type Backup struct {
|
||||
|
||||
term *termstatus.Terminal
|
||||
v uint
|
||||
dry bool
|
||||
}
|
||||
|
||||
// NewBackup returns a new backup progress reporter.
|
||||
@@ -169,7 +168,7 @@ func (b *Backup) ReportTotal(item string, start time.Time, s archiver.ScanStats)
|
||||
}
|
||||
|
||||
// Finish prints the finishing messages.
|
||||
func (b *Backup) Finish(snapshotID restic.ID, start time.Time, summary *ui.Summary) {
|
||||
func (b *Backup) Finish(snapshotID restic.ID, start time.Time, summary *ui.Summary, dryRun bool) {
|
||||
b.print(summaryOutput{
|
||||
MessageType: "summary",
|
||||
FilesNew: summary.Files.New,
|
||||
@@ -185,7 +184,7 @@ func (b *Backup) Finish(snapshotID restic.ID, start time.Time, summary *ui.Summa
|
||||
TotalBytesProcessed: summary.ProcessedBytes,
|
||||
TotalDuration: time.Since(start).Seconds(),
|
||||
SnapshotID: snapshotID.Str(),
|
||||
DryRun: b.dry,
|
||||
DryRun: dryRun,
|
||||
})
|
||||
}
|
||||
|
||||
@@ -193,11 +192,6 @@ func (b *Backup) Finish(snapshotID restic.ID, start time.Time, summary *ui.Summa
|
||||
func (b *Backup) Reset() {
|
||||
}
|
||||
|
||||
// SetDryRun marks the backup as a "dry run".
|
||||
func (b *Backup) SetDryRun() {
|
||||
b.dry = true
|
||||
}
|
||||
|
||||
type statusUpdate struct {
|
||||
MessageType string `json:"message_type"` // "status"
|
||||
SecondsElapsed uint64 `json:"seconds_elapsed,omitempty"`
|
||||
|
||||
Reference in New Issue
Block a user