aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/brew.h.rb10
1 files changed, 8 insertions, 2 deletions
diff --git a/Library/Homebrew/brew.h.rb b/Library/Homebrew/brew.h.rb
index 24f51108f..4af4ae47a 100644
--- a/Library/Homebrew/brew.h.rb
+++ b/Library/Homebrew/brew.h.rb
@@ -403,10 +403,16 @@ def search_brews text
require "formula"
formulae = Formulary.names with_aliases=true
if text =~ /^\/(.*)\/$/
- return formulae.grep(Regexp.new($1))
+ results = formulae.grep(Regexp.new($1))
else
search_term = Regexp.escape(text || "")
- return formulae.grep(/.*#{search_term}.*/)
+ results = formulae.grep(/.*#{search_term}.*/)
+ end
+
+ # Filter out aliases when the full name was also found
+ aliases = Formulary.get_aliases
+ return results.select do |r|
+ aliases[r] == nil or not (results.include? aliases[r])
end
end