lib/hook/hookapp.rb
# Search bookmarks, using both names and addresses unless options contain ":names_only".
# Return results as formatted list.
Search bookmarks, using both names and addresses unless options contain ":names_only".
Return results as formatted list.
Search bookmarks using both names and addresses unless options contain " : names_only " . Return results as formatted list .
def search_bookmarks(search, opts)
    unless search.nil? || search.empty?
      result = search_name(search)
      unless opts[:names_only]
        more_results = search_path_or_address(search)
        result = result.concat(more_results).uniq
      end
    else
      result = all_bookmarks
    end
    separator = opts[:format] == 'paths' && opts[:null_separator] ? "\0" : "\n"
    output = output_array(result, opts)
    if opts[:format] =~ /^v/
      "Search results for: #{search}\n---------\n" + output.join("\n") if output
    else
      output.join(separator) if output
    end
  end
def search_bookmarks ( search , opts ) unless search . nil? || search . empty? result = search_name ( search ) unless opts [ :names_only ] more_results = search_path_or_address ( search ) result = result . concat ( more_results ) . uniq end else result = all_bookmarks end separator = opts [ :format ] == 'paths' && opts [ :null_separator ] ? "\0" : "\n" output = output_array ( result , opts ) if opts [ :format ] =~ / ^v / "Search results for: #{search}\n---------\n" + output . join ( "\n" ) if output else output . join ( separator ) if output end end
Search bookmarks, using both names and addresses unless options contain ":names_only".
Search bookmarks using both names and addresses unless options contain " : names_only " .
search
<not_specific>
opts
<not_specific>