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
10
internal/ui/terminal.go
Normal file
10
internal/ui/terminal.go
Normal file
|
@ -0,0 +1,10 @@
|
|||
package ui
|
||||
|
||||
// Terminal is used to write messages and display status lines which can be
|
||||
// updated. See termstatus.Terminal for a concrete implementation.
|
||||
type Terminal interface {
|
||||
Print(line string)
|
||||
Error(line string)
|
||||
SetStatus(lines []string)
|
||||
CanUpdateStatus() bool
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue