lib/scss_lint/options.rb in scss_lint-0.43.2 vs lib/scss_lint/options.rb in scss_lint-0.44.0
- old
+ new
@@ -1,11 +1,11 @@
require 'optparse'
module SCSSLint
# Handles option parsing for the command line application.
class Options
- DEFAULT_REPORTER = ['Default', :stdout]
+ DEFAULT_REPORTER = ['Default', :stdout].freeze
# Parses command line options into an options hash.
#
# @param args [Array<String>] arguments passed via the command line
# @return [Hash] parsed options
@@ -98,9 +98,13 @@
@options[:show_formatters] = true
end
parser.on_tail('--show-linters', 'Display available linters') do
@options[:show_linters] = true
+ end
+
+ parser.on('--[no-]color', 'Force output to be colorized') do |color|
+ @options[:color] = color
end
parser.on_tail('-h', '--help', 'Display help documentation') do
@options[:help] = parser.help
end