Class: LiquidLint::CLI
- Inherits:
-
Object
- Object
- LiquidLint::CLI
- Defined in:
- lib/liquid_lint/cli.rb
Overview
Command line application interface.
Constant Summary collapse
- EX_OK =
Exit codes
0
- EX_USAGE =
64
- EX_DATAERR =
65
- EX_NOINPUT =
67
- EX_SOFTWARE =
70
- EX_CONFIG =
78
Instance Method Summary collapse
-
#initialize(logger) ⇒ CLI
constructor
Create a CLI that outputs to the specified logger.
-
#run(args) ⇒ Integer
Parses the given command-line arguments and executes appropriate logic based on those arguments.
Constructor Details
#initialize(logger) ⇒ CLI
Create a CLI that outputs to the specified logger.
21 22 23 |
# File 'lib/liquid_lint/cli.rb', line 21 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.
30 31 32 33 34 35 |
# File 'lib/liquid_lint/cli.rb', line 30 def run(args) = LiquidLint::Options.new.parse(args) () rescue StandardError => e handle_exception(e) end |