Class: LighthouseCLI::Parser

Inherits:
Object
  • Object
show all
Extended by:
Commands, Helpers
Defined in:
lib/lighthouse_cli/parser.rb

Class Method Summary collapse

Methods included from Commands

add, help, list, ms, open, resolve, show

Class Method Details

.parse_argv!Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/lighthouse_cli/parser.rb', line 7

def parse_argv!
  (help; return) if ARGV.blank?

  LighthouseCLI.bootstrap!
  @project = LighthouseCLI.project
  
  if self.respond_to?(meth = ARGV.shift.to_sym) && meth != :parse_argv!
    self.send(meth, *ARGV)
  else
    puts "Unknown command \"#{meth}\"."
  end
rescue ActiveResource::TimeoutError, ActiveResource::ServerError
  puts "There seems to be a problem with lighthouse server. Try again in a few."
end