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
  unavailable:    69, # Required library is unavailable
  software:       70, # Internal software error
  config:         78, # Configuration error
  no_files:       80, # No files matched by specified glob patterns
  files_filtered: 81, # All matched files were filtered by exclusions
}

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



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

def config
  @config
end

#optionsObject (readonly)

Returns the value of attribute options.



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

def options
  @options
end

Instance Method Details

#run(args) ⇒ Object



25
26
27
28
29
30
# File 'lib/scss_lint/cli.rb', line 25

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