Class: SCSSLint::CLI

Inherits:
Object
  • Object
show all
Defined in:
lib/scss_lint/cli.rb

Overview

Responsible for parsing command-line options and executing the appropriate application logic based on the options specified.

Constant Summary collapse

EXIT_CODES =

Subset of semantic exit codes conforming to `sysexits` documentation.

{
  ok:        0,
  warning:   1,  # One or more warnings (but no errors) were reported
  error:     2,  # One or more errors were reported
  usage:     64, # Command line usage error
  no_input:  66, # Input file did not exist or was not readable
  software:  70, # Internal software error
  config:    78, # Configuration error
}

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config


10
11
12
# File 'lib/scss_lint/cli.rb', line 10

def config
  @config
end

#optionsObject (readonly)

Returns the value of attribute options


10
11
12
# File 'lib/scss_lint/cli.rb', line 10

def options
  @options
end

Instance Method Details

#run(args) ⇒ Object


23
24
25
26
27
28
# File 'lib/scss_lint/cli.rb', line 23

def run(args)
  options = SCSSLint::Options.new.parse(args)
  act_on_options(options)
rescue => ex
  handle_runtime_exception(ex)
end