Class: HamlLint::CLI

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

Overview

Command line application interface.

Instance Method Summary collapse

Constructor Details

#initialize(logger) ⇒ CLI

Create a CLI that outputs to the specified logger.

Parameters:



12
13
14
# File 'lib/haml_lint/cli.rb', line 12

def initialize(logger)
  @log = logger
end

Instance Method Details

#run(args) ⇒ Integer

Parses the given command-line arguments and executes appropriate logic based on those arguments.

Parameters:

  • args (Array<String>)

    command line arguments

Returns:

  • (Integer)

    exit status code



21
22
23
24
25
26
# File 'lib/haml_lint/cli.rb', line 21

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