Class: LintTrappings::Cli
- Inherits:
-
Object
- Object
- LintTrappings::Cli
- Defined in:
- lib/lint_trappings/cli.rb
Overview
Command line application interface.
Instance Method Summary collapse
-
#initialize(application, output) ⇒ Cli
constructor
A new instance of Cli.
-
#run(args) ⇒ Integer
Parses the given command line arguments and executes appropriate logic based on those arguments.
Constructor Details
#initialize(application, output) ⇒ Cli
Returns a new instance of Cli.
9 10 11 12 |
# File 'lib/lint_trappings/cli.rb', line 9 def initialize(application, output) @application = application @output = output end |
Instance Method Details
#run(args) ⇒ Integer
Parses the given command line arguments and executes appropriate logic based on those arguments.
20 21 22 23 24 25 26 27 28 29 |
# File 'lib/lint_trappings/cli.rb', line 20 def run(args) = ArgumentsParser.new(@application).parse(args) @application.run() 0 # OK rescue ScanWarned, ScanFailed => ex # Special errors which we don't want to display, but do want their exit status ex.exit_status rescue => ex handle_exception(ex) end |