Class: Wright::CLI

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

Overview

Wright command-line interface.

Instance Method Summary collapse

Constructor Details

#initialize(main) ⇒ CLI



7
8
9
10
11
# File 'lib/wright/cli.rb', line 7

def initialize(main)
  @commands = []
  @main = main
  @parser = option_parser
end

Instance Method Details

#run(argv) ⇒ Object

Runs a wright script with the supplied arguments.



16
17
18
19
20
21
22
23
24
# File 'lib/wright/cli.rb', line 16

def run(argv)
  arguments = parse(argv)
  return if @quit

  Wright.log.level = @log_level if @log_level
  @main.extend Wright::DSL

  run_script(arguments)
end