restore: print JSON versions of errors in --json mode
Previously, they were printed as freeform text. This also adds a ui.Terminal interface to make writing tests easier and also adds a few tests.
This commit is contained in:
parent
ad2585af67
commit
a376323331
17 changed files with 234 additions and 70 deletions
|
@ -15,7 +15,7 @@ import (
|
|||
type TextProgress struct {
|
||||
*ui.Message
|
||||
|
||||
term *termstatus.Terminal
|
||||
term ui.Terminal
|
||||
verbosity uint
|
||||
}
|
||||
|
||||
|
@ -23,7 +23,7 @@ type TextProgress struct {
|
|||
var _ ProgressPrinter = &TextProgress{}
|
||||
|
||||
// NewTextProgress returns a new backup progress reporter.
|
||||
func NewTextProgress(term *termstatus.Terminal, verbosity uint) *TextProgress {
|
||||
func NewTextProgress(term ui.Terminal, verbosity uint) *TextProgress {
|
||||
return &TextProgress{
|
||||
Message: ui.NewMessage(term, verbosity),
|
||||
term: term,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue