Method: Madness::CommandLine#execute

Defined in:
lib/madness/command_line.rb

#execute(argv = []) ⇒ Object

Process ARGV by putting it through docopt



14
15
16
17
18
19
20
21
22
23
# File 'lib/madness/command_line.rb', line 14

def execute(argv=[])
  doc = File.read File.expand_path('docopt.txt', __dir__)
  
  begin
    args = Docopt.docopt(doc, argv: argv, version: VERSION)
    handle args
  rescue Docopt::Exit => e
    puts e.message
  end
end