backup: embed progress.Printer in backup specific printer

This commit is contained in:
Michael Eischer
2025-09-14 19:47:54 +02:00
parent e753941ad3
commit 1a76f988ea
5 changed files with 31 additions and 32 deletions

View File

@@ -7,11 +7,12 @@ import (
"github.com/restic/restic/internal/archiver"
"github.com/restic/restic/internal/restic"
"github.com/restic/restic/internal/ui"
"github.com/restic/restic/internal/ui/progress"
)
// JSONProgress reports progress for the `backup` command in JSON.
type JSONProgress struct {
*ui.Message
progress.Printer
term ui.Terminal
v uint
@@ -23,7 +24,7 @@ var _ ProgressPrinter = &JSONProgress{}
// NewJSONProgress returns a new backup progress reporter.
func NewJSONProgress(term ui.Terminal, verbosity uint) *JSONProgress {
return &JSONProgress{
Message: ui.NewMessage(term, verbosity),
Printer: ui.NewProgressPrinter(true, verbosity, term),
term: term,
v: verbosity,
}