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:



14
15
16
# File 'lib/haml_lint/cli.rb', line 14

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



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

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