command: adhere to -no-color, fix test [GH-250]

This commit is contained in:
Mitchell Hashimoto 2014-09-08 20:41:10 -07:00
parent ab5e07a1f9
commit 69294b1ba3
3 changed files with 3 additions and 1 deletions

View File

@ -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]

View File

@ -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
}

View File

@ -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)