Method: Enom::CLI#execute
- Defined in:
- lib/enom/cli.rb
#execute(command_name, args, options = {}) ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/enom/cli.rb', line 20 def execute(command_name, args, ={}) command = commands[command_name] if command begin command.new.execute(args, ) rescue Enom::Error => e puts "An error occurred: #{e.}" rescue RuntimeError => e puts "An error occurred: #{e.}" end else raise CommandNotFound, "Unknown command: #{command_name}" end end |