Method: ExtraSpace::CLI#parse

Defined in:
lib/extraspace/cli.rb

#parse(argv = ARGV) ⇒ Object

Parameters:

  • (defaults to: ARGV)


19
20
21
22
23
24
25
26
27
28
29
# File 'lib/extraspace/cli.rb', line 19

def parse(argv = ARGV)
  parser.parse!(argv)
  command = argv.shift

  case command
  when 'crawl' then crawl(*argv)
  else
    warn("unsupported command=#{command.inspect}")
    exit(Code::ERROR)
  end
end