Class: SCSSLint::Options
- Inherits:
-
Object
- Object
- SCSSLint::Options
- Defined in:
- lib/scss_lint/options.rb
Overview
Handles option parsing for the command line application.
Constant Summary collapse
- DEFAULT_REPORTER =
['Default', :stdout]
Instance Method Summary collapse
-
#parse(args) ⇒ Hash
Parses command line options into an options hash.
Instance Method Details
#parse(args) ⇒ Hash
Parses command line options into an options hash.
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/scss_lint/options.rb', line 12 def parse(args) @options = { reporters: [DEFAULT_REPORTER], } OptionParser.new do |parser| parser. = "Usage: #{parser.program_name} [options] [scss-files]" parser parser parser parser end.parse!(args) # Any remaining arguments are assumed to be files @options[:files] = args @options rescue OptionParser::InvalidOption => ex raise SCSSLint::Exceptions::InvalidCLIOption, ex., ex.backtrace end |