2013-10-30 70 views

回答

8

--no-color只是禁用了彩色的Vagrant輸出。

不出現的時刻被記錄,但搜索Vagrant Github repo顯示以下內容:

bin/vagrant

# Disable color in a few cases: 
# 
# * --no-color is anywhere in our arguments 
# * STDOUT is not a TTY 
# * The terminal doesn't support colors (Windows) 
# 
if ARGV.include?("--no-color") 
    # Delete the argument from the list so that it doesn't 
    # cause any invalid arguments down the road. 
    ARGV.delete("--no-color") 

    opts[:ui_class] = Vagrant::UI::Basic 
elsif !Vagrant::Util::Platform.terminal_supports_colors? 
    opts[:ui_class] = Vagrant::UI::Basic 
elsif !$stdout.tty? && !Vagrant::Util::Platform.cygwin? 
    # 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