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:
Michael Terry committed 2024-08-03 15:18:46 -04:00
1 parent ad2585af67
commit a376323331
17 files changed
+234 -70

No files matched your search

+2 -2
View File
@@ -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,