backup: extract StdioWrapper from ProgressPrinters

The StdioWrapper is not used at all by the ProgressPrinters. It is
called a bit earlier than previously. However, as the password prompt
directly accessed stdin/stdout this doesn't cause problems.
This commit is contained in:
Michael Eischer
2023-01-14 00:58:13 +01:00
parent 74348be3fa
commit c15b4bceae
5 changed files with 14 additions and 25 deletions
+2 -4
View File
@@ -14,7 +14,6 @@ import (
// TextProgress reports progress for the `backup` command.
type TextProgress struct {
*ui.Message
*ui.StdioWrapper
term *termstatus.Terminal
}
@@ -25,9 +24,8 @@ var _ ProgressPrinter = &TextProgress{}
// NewTextProgress returns a new backup progress reporter.
func NewTextProgress(term *termstatus.Terminal, verbosity uint) *TextProgress {
return &TextProgress{
Message: ui.NewMessage(term, verbosity),
StdioWrapper: ui.NewStdioWrapper(term),
term: term,
Message: ui.NewMessage(term, verbosity),
term: term,
}
}