Method: Hookify::Command.run

Defined in:
lib/hookify/command.rb

.run(command, args) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
# File 'lib/hookify/command.rb', line 11

def run(command, args)
  begin
    run_command(command, args.dup)
  rescue InvalidCommand
    error "Unknown command '#{command.to_s}'. Run 'hookify help' for usage information."
  rescue CommandFailed => e
    error e.message
  rescue Interrupt => e
    error "\n[canceled]"
  end
end