Method: Ppl::Application::Router#route

Defined in:
lib/ppl/application/router.rb

#route(argument) ⇒ Object



13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/ppl/application/router.rb', line 13

def route(argument)
  command = @command_suite.find_command(argument)
  if command.nil? && @aliases.has_key?(argument)
    if is_bang_alias?(argument)
      command = create_external_command(argument)
    else
      command = @command_suite.find_command(@aliases[argument])
    end
  end
  if command.nil? && !@default.nil?
    command = @command_suite.find_command(@default)
  end
  return command
end