From 69294b1ba31b71c43ff33f902be30207b9add667 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Mon, 8 Sep 2014 20:41:10 -0700 Subject: [PATCH] command: adhere to -no-color, fix test [GH-250] --- CHANGELOG.md | 1 + command/meta.go | 2 +- command/meta_test.go | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 22ba3925d..4b59f4bb9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ IMPROVEMENTS: BUG FIXES: * core: Fix certain syntax of configuration that could cause hang. [GH-261] + * core: `-no-color` flag properly disables color. [GH-250] * providers/aws: Refreshing EIP from pre-0.2 state file won't error. [GH-258] * providers/google: Attaching a disk source (not an image) works properly. [GH-254] diff --git a/command/meta.go b/command/meta.go index 1b83e6da9..f5922c589 100644 --- a/command/meta.go +++ b/command/meta.go @@ -154,7 +154,7 @@ func (m *Meta) process(args []string, vars bool) []string { m.color = m.Color for i, v := range args { if v == "-no-color" { - m.Color = false + m.color = false args = append(args[:i], args[i+1:]...) break } diff --git a/command/meta_test.go b/command/meta_test.go index ae209fe6a..8abc92f22 100644 --- a/command/meta_test.go +++ b/command/meta_test.go @@ -36,6 +36,7 @@ func TestMetaColorize(t *testing.T) { // Test disable #1 m = new(Meta) + m.Color = true args = []string{"foo", "-no-color", "bar"} args2 = []string{"foo", "bar"} args = m.process(args, false)