diff options
Diffstat (limited to 'Library/Homebrew')
| -rw-r--r-- | Library/Homebrew/cmd/install.rb | 32 | ||||
| -rw-r--r-- | Library/Homebrew/exceptions.rb | 2 |
2 files changed, 30 insertions, 4 deletions
diff --git a/Library/Homebrew/cmd/install.rb b/Library/Homebrew/cmd/install.rb index f7087ad8b..ac1b37b72 100644 --- a/Library/Homebrew/cmd/install.rb +++ b/Library/Homebrew/cmd/install.rb @@ -98,10 +98,36 @@ module Homebrew else ofail e.message query = query_regexp(e.name) - ohai "Searching formulae..." - puts_columns(search_formulae(query)) + + ohai "Searching for similarly named formulae..." + formulae_search_results = search_formulae(query) + case formulae_search_results.length + when 0 + ofail "No similarly named formulae found." + when 1 + puts "This similarly named formula was found:" + puts_columns(formulae_search_results) + puts "To install it, run:\n brew install #{formulae_search_results.first}" + else + puts "These similarly named formulae were found:" + puts_columns(formulae_search_results) + puts "To install one of them, run (for example):\n brew install #{formulae_search_results.first}" + end + ohai "Searching taps..." - puts_columns(search_taps(query)) + taps_search_results = search_taps(query) + case taps_search_results.length + when 0 + ofail "No formulae found in taps." + when 1 + puts "This formula was found in a tap:" + puts_columns(taps_search_results) + puts "To install it, run:\n brew install #{taps_search_results.first}" + else + puts "These formulae were found in taps:" + puts_columns(taps_search_results) + puts "To install one of them, run (for example):\n brew install #{taps_search_results.first}" + end # If they haven't updated in 48 hours (172800 seconds), that # might explain the error diff --git a/Library/Homebrew/exceptions.rb b/Library/Homebrew/exceptions.rb index 957fc42b9..29cd480d5 100644 --- a/Library/Homebrew/exceptions.rb +++ b/Library/Homebrew/exceptions.rb @@ -47,7 +47,7 @@ class FormulaUnavailableError < RuntimeError end def to_s - "No available formula for #{name} #{dependent_s}" + "No available formula with the name \"#{name}\" #{dependent_s}" end end |
