lib/haml_lint/options.rb
# Parses command line options into an options hash.
#
# @param args [Array<String>] arguments passed via the command line
# @return [Hash] parsed options
Parses command line options into an options hash.
Parses command line options into an options hash .
def add_linter_options(parser)
      parser.on('-e', '--exclude file,...', Array,
                'List of file names to exclude') do |files|
        @options[:excluded_files] = files
      end
      parser.on('-i', '--include-linter linter,...', Array,
                'Specify which linters you want to run') do |linters|
        @options[:included_linters] = linters
      end
      parser.on('-x', '--exclude-linter linter,...', Array,
                "Specify which linters you don't want to run") do |linters|
        @options[:excluded_linters] = linters
      end
    end
def add_linter_options ( parser ) parser . on ( '-e' , '--exclude file,...' , Array , 'List of file names to exclude' ) do | files | @options [ :excluded_files ] = files end parser . on ( '-i' , '--include-linter linter,...' , Array , 'Specify which linters you want to run' ) do | linters | @options [ :included_linters ] = linters end parser . on ( '-x' , '--exclude-linter linter,...' , Array , "Specify which linters you don't want to run" ) do | linters | @options [ :excluded_linters ] = linters end end
Parses command line options into an options hash.
Parses command line options into an options hash .
None
Hash
parser
args
arguments passed via the command line
arguments passed via the command line