aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/brew.h.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/Library/Homebrew/brew.h.rb b/Library/Homebrew/brew.h.rb
index bd4153b16..24f51108f 100644
--- a/Library/Homebrew/brew.h.rb
+++ b/Library/Homebrew/brew.h.rb
@@ -399,6 +399,17 @@ def outdated_brews
return results
end
+def search_brews text
+ require "formula"
+ formulae = Formulary.names with_aliases=true
+ if text =~ /^\/(.*)\/$/
+ return formulae.grep(Regexp.new($1))
+ else
+ search_term = Regexp.escape(text || "")
+ return formulae.grep(/.*#{search_term}.*/)
+ end
+end
+
########################################################## class PrettyListing
class PrettyListing
def initialize path