forked from cloudfoundry/bosh-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
non_interactive.go
66 lines (50 loc) · 1.55 KB
/
non_interactive.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
package ui
import (
. "github.com/cloudfoundry/bosh-cli/ui/table"
)
type nonInteractiveUI struct {
parent UI
}
func NewNonInteractiveUI(parent UI) UI {
return &nonInteractiveUI{parent: parent}
}
func (ui *nonInteractiveUI) ErrorLinef(pattern string, args ...interface{}) {
ui.parent.ErrorLinef(pattern, args...)
}
func (ui *nonInteractiveUI) PrintLinef(pattern string, args ...interface{}) {
ui.parent.PrintLinef(pattern, args...)
}
func (ui *nonInteractiveUI) BeginLinef(pattern string, args ...interface{}) {
ui.parent.BeginLinef(pattern, args...)
}
func (ui *nonInteractiveUI) EndLinef(pattern string, args ...interface{}) {
ui.parent.EndLinef(pattern, args...)
}
func (ui *nonInteractiveUI) PrintBlock(block string) {
ui.parent.PrintBlock(block)
}
func (ui *nonInteractiveUI) PrintErrorBlock(block string) {
ui.parent.PrintErrorBlock(block)
}
func (ui *nonInteractiveUI) PrintTable(table Table) {
ui.parent.PrintTable(table)
}
func (ui *nonInteractiveUI) AskForText(label string) (string, error) {
panic("Cannot ask for input in non-interactive UI")
}
func (ui *nonInteractiveUI) AskForChoice(label string, options []string) (int, error) {
panic("Cannot ask for a choice in non-interactive UI")
}
func (ui *nonInteractiveUI) AskForPassword(label string) (string, error) {
panic("Cannot ask for password in non-interactive UI")
}
func (ui *nonInteractiveUI) AskForConfirmation() error {
// Always respond successfully
return nil
}
func (ui *nonInteractiveUI) IsInteractive() bool {
return false
}
func (ui *nonInteractiveUI) Flush() {
ui.parent.Flush()
}