Add ClearLine() to UI implementations

This commit is contained in:
Chris Roberts 2022-02-25 15:57:12 -08:00 committed by Paul Hinze
parent 71fb214d95
commit 6ba7807f7b
No known key found for this signature in database
GPG Key ID: B69DEDF2D55501C0
2 changed files with 10 additions and 0 deletions

View File

@ -42,6 +42,10 @@ func (u *runnerUI) Interactive() bool {
return false
}
func (u *runnerUI) ClearLine() {
// NO-OP - noninteractive
}
// Output outputs a message directly to the terminal. The remaining
// arguments should be interpolations for the format string. After the
// interpolations you may add Options.

View File

@ -37,6 +37,12 @@ func (u *multiUI) Input(input *terminal.Input) (string, error) {
return term.Input(input)
}
func (u *multiUI) ClearLine() {
for _, u := range u.UIs {
u.ClearLine()
}
}
func (u *multiUI) Interactive() bool {
for _, u := range u.UIs {
if u.Interactive() {