lib/scss_lint/cli.rb in scss-lint-0.11.1 vs lib/scss_lint/cli.rb in scss-lint-0.12.0
- old
+ new
@@ -1,8 +1,10 @@
require 'optparse'
module SCSSLint
+ # Responsible for parsing command-line options and executing the appropriate
+ # application logic based on the options specified.
class CLI
attr_accessor :options
def initialize(args = [])
@args = args
@@ -60,13 +62,18 @@
def run
runner = Runner.new(options)
runner.run(find_files)
report_lints(runner.lints)
- halt 1 if runner.lints?
+ halt(1) if runner.lints?
rescue NoFilesError, NoSuchLinter, Errno::ENOENT => ex
puts ex.message
- halt -1
+ halt(-1)
+ rescue => ex
+ puts ex.message
+ puts ex.backtrace
+ puts 'Report this bug at '.yellow + BUG_REPORT_URL.cyan
+ halt(-1)
end
private
def find_files