aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/formula_installer.rb16
-rw-r--r--Library/Homebrew/keg.rb9
2 files changed, 25 insertions, 0 deletions
diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb
index a2768f7a1..bd341c365 100644
--- a/Library/Homebrew/formula_installer.rb
+++ b/Library/Homebrew/formula_installer.rb
@@ -158,6 +158,22 @@ class FormulaInstaller
check_infopages
check_m4
end
+
+ keg = Keg.new(f.prefix)
+
+ if keg.completion_installed? :bash
+ ohai 'Caveats', <<-EOS.undent
+ Bash completion has been installed to:
+ #{HOMEBREW_PREFIX}/etc/bash_completion.d
+ EOS
+ end
+
+ if keg.completion_installed? :zsh
+ ohai 'Caveats', <<-EOS.undent
+ zsh completion has been installed to:
+ #{HOMEBREW_PREFIX}/share/zsh/site-functions
+ EOS
+ end
end
def finish
diff --git a/Library/Homebrew/keg.rb b/Library/Homebrew/keg.rb
index 269999bc3..dae91ea1d 100644
--- a/Library/Homebrew/keg.rb
+++ b/Library/Homebrew/keg.rb
@@ -58,6 +58,15 @@ class Keg < Pathname
linked_keg_record.directory? and self == linked_keg_record.realpath
end
+ def completion_installed? shell
+ dir = case shell
+ when :bash then self/'etc/bash_completion.d'
+ when :zsh then self/'share/zsh/site-functions'
+ end
+ return if dir.nil?
+ dir.directory? and not dir.children.length.zero?
+ end
+
def link mode=nil
raise "Cannot link #{fname}\nAnother version is already linked: #{linked_keg_record.realpath}" if linked_keg_record.directory?