Class: AudioFeedManager::CLI

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

Instance Method Summary collapse

Instance Method Details

#run(argv) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/audio_feed_manager/cli.rb', line 5

def run(argv)
  command, options = commands_list.get(argv)
  args = arguments_parser.parse(command.arguments, options)
  command.run(args.to_hash)
rescue UnknownCommand => e
  console.fail(e)
  help.print_usage
  raise StopApplication
rescue InvalidArguments => e
  console.fail(e)
  help.print_command_usage(command.name)
  raise StopApplication
end