disable colors if they're already enabled

This commit is contained in:
John Bintz 2011-05-03 10:20:59 -04:00
parent ed749136e5
commit ee8f8382cb
2 changed files with 6 additions and 2 deletions

View File

@ -33,7 +33,8 @@ Tested in the following environments:
Current supported options:
* `-c` enables color output
* `-c`/`--colors` enables color output
* `--no-colors` disables color output
These options can also be placed into a `.jasmine-headless-webkit` file in your project root.

View File

@ -5,7 +5,8 @@ require 'fileutils'
require 'getoptlong'
opts = GetoptLong.new(
[ '--colors', '-c', GetoptLong::NO_ARGUMENT ]
[ '--colors', '-c', GetoptLong::NO_ARGUMENT ],
[ '--no-colors', GetoptLong::NO_ARGUMENT ]
)
options = { :colors => false }
@ -15,6 +16,8 @@ process_options = lambda { |*args|
case opt
when '--colors', '-c'
options[:colors] = true
when '--no-colors', '-nc'
options[:colors] = false
end
}