class Pry::CommandSet

def complete(search, context = {})

Returns:
  • (Array) -

Parameters:
  • context (Hash) -- The context to create the command with
  • search (String) -- The line to search for
def complete(search, context = {})
  if (command = find_command(search))
    command.new(context).complete(search)
  else
    keys = @commands.keys.select do |key|
      key.is_a?(String) && key.start_with?(search)
    end
    keys.map { |key| key + " " }
  end
end