class GLI::Commands::HelpModules::CommandFinder

Finds commands from the application/command data structures

Attributes

last_found_command[R]
last_unknown_command[R]
squelch_stderr[W]

Public Instance Methods

find_command(name) click to toggle source
# 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

Public Class Methods

new(app,arguments,error) click to toggle source
# File lib/gli/commands/help_modules/command_finder.rb, line 11
def initialize(app,arguments,error)
  @app = app
  @arguments = arguments
  @error = error
  @squelch_stderr = false
  @last_unknown_command = nil
end