Because we default the color setting to "false" on Microsoft Windows,
the heuristics used to detect which type of setting we're using were
getting confused, and mis-detected color as being a BooleanSetting
rather than just a Setting.

By specifying that color is a "Setting", we can skip the
auto-detection, and avoid this problem entirely.

Reviewed-by: Josh Cooper <j...@puppetlabs.com>
Signed-off-by: Jacob Helwig <ja...@puppetlabs.com>
---

Local-branch: ticket/master/8356-color-setting-on-windows

 lib/puppet/defaults.rb |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/lib/puppet/defaults.rb b/lib/puppet/defaults.rb
index 488b991..d5e06c5 100644
--- a/lib/puppet/defaults.rb
+++ b/lib/puppet/defaults.rb
@@ -47,10 +47,14 @@ module Puppet
       exits.  Comma-separate multiple values.  For a list of all values,
       specify 'all'.  This feature is only available in Puppet versions
       higher than 0.18.4."],
-    :color => [(Puppet.features.microsoft_windows? ? "false" : "ansi"), 
"Whether to use colors when logging to the console.
+    :color => {
+      :default => (Puppet.features.microsoft_windows? ? "false" : "ansi"),
+      :type    => :setting,
+      :desc    => "Whether to use colors when logging to the console.
       Valid values are `ansi` (equivalent to `true`), `html` (mostly
       used during testing with TextMate), and `false`, which produces
-      no color."],
+      no color.",
+    },
     :mkusers => [false,
       "Whether to create the necessary user and group that puppet agent will
       run as."],
-- 
1.7.6

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To post to this group, send email to puppet-dev@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-dev+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-dev?hl=en.

Reply via email to