Method: GLI::Commands::HelpModules::CommandFinder#find_command

Defined in:
lib/gli/commands/help_modules/command_finder.rb

#find_command(name) ⇒ Object



19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/gli/commands/help_modules/command_finder.rb', line 19

def find_command(name)
  command = find_command_from_base(name,@app)
  return if unknown_command?(command,name,@error)
  @last_found_command = command
  while !@arguments.empty?
    name = @arguments.shift
    command = find_command_from_base(name,command)
    return if unknown_command?(command,name,@error)
    @last_found_command = command
  end
  command
end