Add machine readable bool endpoint to terminal ui
This commit is contained in:
parent
4ffe33461c
commit
194882214a
@ -42,6 +42,10 @@ func (u *runnerUI) Interactive() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
func (u *runnerUI) MachineReadable() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
func (u *runnerUI) ClearLine() {
|
||||
// NO-OP - noninteractive
|
||||
}
|
||||
|
||||
@ -52,6 +52,15 @@ func (u *multiUI) Interactive() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
func (u *multiUI) MachineReadable() bool {
|
||||
for _, u := range u.UIs {
|
||||
if u.MachineReadable() {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (u *multiUI) Output(msg string, raw ...interface{}) {
|
||||
for _, u := range u.UIs {
|
||||
u.Output(msg, raw...)
|
||||
|
||||
@ -44,7 +44,7 @@ module Vagrant
|
||||
end
|
||||
|
||||
def machine(type, *data)
|
||||
if client.is_interactive
|
||||
if !client.is_machine_readable
|
||||
@logger.info("Machine: #{type} #{data.inspect}")
|
||||
return
|
||||
end
|
||||
|
||||
@ -22,6 +22,10 @@ module VagrantPlugins
|
||||
client.is_interactive(Empty.new).interactive
|
||||
end
|
||||
|
||||
def is_machine_readable
|
||||
client.is_machine_readable(Empty.new).machine_readable
|
||||
end
|
||||
|
||||
def input(prompt, **opts)
|
||||
event_resp = client.events(
|
||||
[
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user