From e263f1f0057f6cac15ef588c681e6f49713c3975 Mon Sep 17 00:00:00 2001
From: Andrew Hodges <betawaffle@gmail.com>
Date: Sat, 28 May 2011 10:57:48 -0400
Subject: Brew Plugin

Merge completion with official brew completion. Add a helper to link official
completion into oh-my-zsh plugin (without overwriting). Add an alias to list
installed brews. Add brews to the path (in a somewhat strange way).
---
 plugins/brew/_brew           | 24 +++++++++++++++++-------
 plugins/brew/brew.plugin.zsh | 13 +++++++++++++
 2 files changed, 30 insertions(+), 7 deletions(-)
 create mode 100644 plugins/brew/brew.plugin.zsh

(limited to 'plugins/brew')

diff --git a/plugins/brew/_brew b/plugins/brew/_brew
index cee1e25f0..1dcf0a4bf 100644
--- a/plugins/brew/_brew
+++ b/plugins/brew/_brew
@@ -25,10 +25,12 @@ _1st_arguments=(
   'link:link a formula'
   'list:list files in a formula or not-installed formulae'
   'log:git commit log for a formula'
+  'missing:check all installed formuale for missing dependencies.'
   'outdated:list formulas for which a newer version is available'
   'prune:remove dead links'
   'remove:remove a formula'
   'search:search for a formula (/regex/ or string)'
+  'server:start a local web app that lets you browse formulae (requires Sinatra)'
   'unlink:unlink a formula'
   'update:freshen up links'
   'upgrade:upgrade outdated formulae'
@@ -36,10 +38,14 @@ _1st_arguments=(
 )
 
 local expl
-local -a formula installed_formulae
+local -a formulae installed_formulae
 
 _arguments \
-  '(-v --verbose)'{-v,--verbose}'[verbose]' \
+  '(-v)-v[verbose]' \
+  '(--cellar)--cellar[brew cellar]' \
+  '(--config)--config[brew configuration]' \
+  '(--env)--env[brew environment]' \
+  '(--repository)--repository[brew repository]' \
   '(--version)--version[version information]' \
   '(--prefix)--prefix[where brew lives on this system]' \
   '(--cache)--cache[brew cache]' \
@@ -51,20 +57,24 @@ if (( CURRENT == 1 )); then
 fi
 
 case "$words[1]" in
-  list)
+  search|-S)
+    _arguments \
+      '(--macports)--macports[search the macports repository]' \
+      '(--fink)--fink[search the fink repository]' ;;
+  list|ls)
     _arguments \
       '(--unbrewed)--unbrewed[files in brew --prefix not controlled by brew]' \
+      '(--versions)--versions[list all installed versions of a formula]' \
       '1: :->forms' &&  return 0
 
       if [[ "$state" == forms ]]; then
         _brew_installed_formulae
-        _requested installed_formulae expl 'installed formulae' compadd -a installed_formulae
+        _wanted installed_formulae expl 'installed formulae' compadd -a installed_formulae
       fi ;;
-  install|home|log|info|uses|cat|deps)
+  install|home|homepage|log|info|abv|uses|cat|deps|edit|options)
     _brew_all_formulae
     _wanted formulae expl 'all formulae' compadd -a formulae ;;
-  remove|edit|xo)
+  remove|rm|uninstall|unlink|cleanup|link|ln)
     _brew_installed_formulae
     _wanted installed_formulae expl 'installed formulae' compadd -a installed_formulae ;;
 esac
-
diff --git a/plugins/brew/brew.plugin.zsh b/plugins/brew/brew.plugin.zsh
new file mode 100644
index 000000000..f584a4684
--- /dev/null
+++ b/plugins/brew/brew.plugin.zsh
@@ -0,0 +1,13 @@
+# Move /usr/local/bin (path where brews are linked) to the front of the path
+# This will allow us to override system binaries like ruby with our brews
+# TODO: Do this in a more compatible way.
+#       What if someone doesn't have /usr/bin in their path?
+export PATH=`echo $PATH | sed -e 's|/usr/local/bin||' -e 's|::|:|g'` # Remove /usr/local/bin
+export PATH=`echo $PATH | sed -e 's|/usr/bin|/usr/local/bin:&|'`     # Add it in front of /usr/bin
+export PATH=`echo $PATH | sed -e 's|/usr/bin|/usr/local/sbin:&|'`    # Add /usr/local/sbin
+
+alias brews='brew list -1'
+
+function brew-link-completion {
+	ln -s "$(brew --prefix)/Library/Contributions/brew_zsh_completion.zsh" "$ZSH/plugins/brew/_brew.official"
+}
-- 
cgit v1.2.3-70-g09d2


From 1e3b441ce7e0b8706867801c1e5e7ca6760ff17e Mon Sep 17 00:00:00 2001
From: Andrew Hodges <betawaffle@gmail.com>
Date: Mon, 30 May 2011 10:07:15 -0400
Subject: Rollback of Pull #366

sorin-ionescu had some good points.
---
 plugins/brew/brew.plugin.zsh | 12 ------------
 plugins/node/node.plugin.zsh |  5 +----
 plugins/npm/npm.plugin.zsh   |  2 --
 plugins/rvm/rvm.plugin.zsh   |  9 ++-------
 4 files changed, 3 insertions(+), 25 deletions(-)
 delete mode 100644 plugins/npm/npm.plugin.zsh

(limited to 'plugins/brew')

diff --git a/plugins/brew/brew.plugin.zsh b/plugins/brew/brew.plugin.zsh
index f584a4684..c2e95884e 100644
--- a/plugins/brew/brew.plugin.zsh
+++ b/plugins/brew/brew.plugin.zsh
@@ -1,13 +1 @@
-# Move /usr/local/bin (path where brews are linked) to the front of the path
-# This will allow us to override system binaries like ruby with our brews
-# TODO: Do this in a more compatible way.
-#       What if someone doesn't have /usr/bin in their path?
-export PATH=`echo $PATH | sed -e 's|/usr/local/bin||' -e 's|::|:|g'` # Remove /usr/local/bin
-export PATH=`echo $PATH | sed -e 's|/usr/bin|/usr/local/bin:&|'`     # Add it in front of /usr/bin
-export PATH=`echo $PATH | sed -e 's|/usr/bin|/usr/local/sbin:&|'`    # Add /usr/local/sbin
-
 alias brews='brew list -1'
-
-function brew-link-completion {
-	ln -s "$(brew --prefix)/Library/Contributions/brew_zsh_completion.zsh" "$ZSH/plugins/brew/_brew.official"
-}
diff --git a/plugins/node/node.plugin.zsh b/plugins/node/node.plugin.zsh
index 18f35333c..519bc18da 100644
--- a/plugins/node/node.plugin.zsh
+++ b/plugins/node/node.plugin.zsh
@@ -1,8 +1,5 @@
-# This works if you installed node via homebrew.
-export NODE_PATH="/usr/local/lib/node"
-
 # Open the node api for your current version to the optional section.
 # TODO: Make the section part easier to use.
-function node-api {
+function node-docs {
 	open "http://nodejs.org/docs/$(node --version)/api/all.html#$1"
 }
diff --git a/plugins/npm/npm.plugin.zsh b/plugins/npm/npm.plugin.zsh
deleted file mode 100644
index 0b0a30e11..000000000
--- a/plugins/npm/npm.plugin.zsh
+++ /dev/null
@@ -1,2 +0,0 @@
-# TODO: Don't do this in such a weird way.
-export PATH=`echo $PATH | sed -e 's|/usr/bin|/usr/local/share/npm/bin:&|'`
diff --git a/plugins/rvm/rvm.plugin.zsh b/plugins/rvm/rvm.plugin.zsh
index 8a3ec788a..40fd88c1a 100644
--- a/plugins/rvm/rvm.plugin.zsh
+++ b/plugins/rvm/rvm.plugin.zsh
@@ -1,6 +1,5 @@
-fpath=($ZSH/plugins/rvm $fpath)
-autoload -U compinit
-compinit -i
+# What does this really do?
+# fpath=($ZSH/plugins/rvm $fpath)
 
 alias rubies='rvm list rubies'
 alias gemsets='rvm gemset list'
@@ -35,10 +34,6 @@ function rvm-update {
 	rvm reload # TODO: Reload rvm completion?
 }
 
-function rvm-link-completion {
-	ln -s "$rvm_path/scripts/zsh/Completion/_rvm" "$ZSH/plugins/rvm/_rvm.official"
-}
-
 # TODO: Make this usable w/o rvm.
 function gems {
 	local current_ruby=`rvm-prompt i v p`
-- 
cgit v1.2.3-70-g09d2