Skip to content
Snippets Groups Projects
Commit 4648aa54 authored by Baptiste Fontaine's avatar Baptiste Fontaine
Browse files

search --desc: cache the query regexp


Closes Homebrew/homebrew#40795.

Signed-off-by: default avatarBaptiste Fontaine <batifon@yahoo.fr>
parent 72cb403a
No related branches found
No related tags found
No related merge requests found
......@@ -23,8 +23,9 @@ module Homebrew
exec_browser "http://packages.ubuntu.com/search?keywords=#{ARGV.next}&searchon=names&suite=all&section=all"
elsif ARGV.include? '--desc'
query = ARGV.next
rx = query_regexp(query)
Formula.each do |formula|
if formula.desc =~ query_regexp(query)
if formula.desc =~ rx
puts "#{formula.full_name}: #{formula.desc}"
end
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment