search --desc: cache the query regexp
Closes Homebrew/homebrew#40795. Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
This commit is contained in:
parent
72cb403a56
commit
4648aa54c0
@ -23,8 +23,9 @@ module Homebrew
|
||||
exec_browser "http://packages.ubuntu.com/search?keywords=#{ARGV.next}&searchon=names&suite=all§ion=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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user