This repository has been archived by the owner on Mar 24, 2022. It is now read-only.
forked from cloudfoundry/bosh-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
indenting_ui.go
67 lines (50 loc) · 1.52 KB
/
indenting_ui.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
package ui
import (
"fmt"
. "github.com/cloudfoundry/bosh-cli/ui/table"
)
type indentingUI struct {
parent UI
}
func NewIndentingUI(parent UI) UI {
return &indentingUI{parent: parent}
}
func (ui *indentingUI) ErrorLinef(pattern string, args ...interface{}) {
ui.parent.ErrorLinef(" %s", fmt.Sprintf(pattern, args...))
}
func (ui *indentingUI) PrintLinef(pattern string, args ...interface{}) {
ui.parent.PrintLinef(" %s", fmt.Sprintf(pattern, args...))
}
func (ui *indentingUI) BeginLinef(pattern string, args ...interface{}) {
ui.parent.BeginLinef(" %s", fmt.Sprintf(pattern, args...))
}
func (ui *indentingUI) EndLinef(pattern string, args ...interface{}) {
ui.parent.EndLinef(pattern, args...)
}
func (ui *indentingUI) PrintBlock(block string) {
ui.parent.PrintBlock(block)
}
func (ui *indentingUI) PrintErrorBlock(block string) {
ui.parent.PrintErrorBlock(block)
}
func (ui *indentingUI) PrintTable(table Table) {
ui.parent.PrintTable(table)
}
func (ui *indentingUI) AskForText(label string) (string, error) {
return ui.parent.AskForText(label)
}
func (ui *indentingUI) AskForChoice(label string, options []string) (int, error) {
return ui.parent.AskForChoice(label, options)
}
func (ui *indentingUI) AskForPassword(label string) (string, error) {
return ui.parent.AskForPassword(label)
}
func (ui *indentingUI) AskForConfirmation() error {
return ui.parent.AskForConfirmation()
}
func (ui *indentingUI) IsInteractive() bool {
return ui.parent.IsInteractive()
}
func (ui *indentingUI) Flush() {
ui.parent.Flush()
}