From 6d9463bfa8ccd116ce77ac9f051e5120929cd186 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Sat, 4 Oct 2014 10:20:35 -0700 Subject: [PATCH] command: set UIOutput --- command/meta.go | 4 ++++ command/ui_output.go | 15 +++++++++++++++ command/ui_output_test.go | 11 +++++++++++ 3 files changed, 30 insertions(+) create mode 100644 command/ui_output.go create mode 100644 command/ui_output_test.go diff --git a/command/meta.go b/command/meta.go index a6bdded50..a58a858a0 100644 --- a/command/meta.go +++ b/command/meta.go @@ -143,6 +143,10 @@ func (m *Meta) contextOpts() *terraform.ContextOpts { } opts.Variables = vs opts.UIInput = m.UIInput() + opts.UIOutput = &UIOutput{ + Colorize: m.Colorize(), + Ui: m.Ui, + } return &opts } diff --git a/command/ui_output.go b/command/ui_output.go new file mode 100644 index 000000000..7e8b574a3 --- /dev/null +++ b/command/ui_output.go @@ -0,0 +1,15 @@ +package command + +import ( + "github.com/mitchellh/cli" + "github.com/mitchellh/colorstring" +) + +// UIOutput is an implementation of terraform.UIOutput. +type UIOutput struct { + Colorize *colorstring.Colorize + Ui cli.Ui +} + +func (u *UIOutput) Output(v string) { +} diff --git a/command/ui_output_test.go b/command/ui_output_test.go new file mode 100644 index 000000000..bff073e86 --- /dev/null +++ b/command/ui_output_test.go @@ -0,0 +1,11 @@ +package command + +import ( + "testing" + + "github.com/hashicorp/terraform/terraform" +) + +func TestUIOutput_impl(t *testing.T) { + var _ terraform.UIOutput = new(UIOutput) +}