aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Vandenberg2010-01-13 10:03:49 -0800
committerMax Howell2010-01-16 15:33:32 +0000
commit75b8a06e1c789566e1ff6f445d7e6bed7e4d7809 (patch)
tree109271be5e3f7851658f8cdfd31c0f099b11e943
parent5bcc1df847f958653206b945cb87ccfee58f1d4f (diff)
downloadhomebrew-75b8a06e1c789566e1ff6f445d7e6bed7e4d7809.tar.bz2
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.
-rw-r--r--Library/Contributions/brew_bash_completion.sh3
-rwxr-xr-xbin/brew2
2 files changed, 3 insertions, 2 deletions
diff --git a/Library/Contributions/brew_bash_completion.sh b/Library/Contributions/brew_bash_completion.sh
index ddd9c17e0..756621cf5 100644
--- a/Library/Contributions/brew_bash_completion.sh
+++ b/Library/Contributions/brew_bash_completion.sh
@@ -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...
diff --git a/bin/brew b/bin/brew
index c3c5938d1..0b14d9751 100755
--- a/bin/brew
+++ b/bin/brew
@@ -75,6 +75,8 @@ begin
case arg = ARGV.shift
when '--prefix'
puts HOMEBREW_PREFIX
+ when '--repository'
+ puts HOMEBREW_REPOSITORY
when '--config'
dump_config