Some bulletproofing for bash completion script.

Since Homebrew's Library doesn't have to be linked under prefix,
we need to do some extra work in the bash completion script to
support this configuration.

Added a "--repository" option to brew, and updated the completion
script to use paths relative to this location.
This commit is contained in:
Adam Vandenberg 2010-01-13 10:03:49 -08:00 committed by Max Howell
parent be842ee554
commit 9dc39c391a
2 changed files with 3 additions and 2 deletions

View File

@ -21,8 +21,7 @@ _brew_to_completion()
return 0
# Subcommands
else
brew_base=`which brew`
brew_base=`dirname ${brew_base}`/..
brew_base=`brew --repository`
case ${prev} in
# Commands that take a formula...

View File

@ -75,6 +75,8 @@ begin
case arg = ARGV.shift
when '--prefix'
puts HOMEBREW_PREFIX
when '--repository'
puts HOMEBREW_REPOSITORY
when '--config'
dump_config