core: improved commenting in bin/vagrant

This commit is contained in:
Mitchell Hashimoto 2013-10-23 23:20:27 -07:00
parent 3002f8d522
commit eb6256316c
2 changed files with 4 additions and 5 deletions

View File

@ -37,7 +37,9 @@ if ARGV.include?("--no-color")
elsif !Vagrant::Util::Platform.terminal_supports_colors?
opts[:ui_class] = Vagrant::UI::Basic
elsif !$stdout.tty? && !Vagrant::Util::Platform.cygwin?
opts[:ui_class] = Vagrant::UI::Basic
# Cygwin always reports STDOUT is not a TTY, so we only disable
# colors if its not a TTY AND its not Cygwin.
opts[:ui_class] = Vagrant::UI::Basic
end
# Also allow users to force colors.

View File

@ -85,10 +85,7 @@ module Vagrant
# Returns a boolean noting whether the terminal supports color.
# output.
def terminal_supports_colors?
if windows?
return ENV.has_key?("ANSICON") || cygwin?
end
return ENV.has_key?("ANSICON") || cygwin? if windows?
true
end