f3f0a54259f384c35dad48a40d6e931df079b3c9

Author
Ed Lui <edmund.lui@gmail.com>
Committer
Ed Lui <edmund.lui@gmail.com>
Date

Message

Updated _brew zsh autocompletion to latest Homebrew upstream

Diff

This diff is truncated to protect this page.

  1diff --git a/plugins/brew/_brew b/plugins/brew/_brew
  2index d4306f2236f143ba3711c5ad2291c0f8f2c4e8c0..9eb3bb557c261e27d853c68e5a396e5ad4bc0596 100644
  3--- a/plugins/brew/_brew
  4+++ b/plugins/brew/_brew
  5@@ -11,10 +11,25 @@ _brew_installed_formulae() {
  6   installed_formulae=(`brew list`)
  7 }
  8 
  9+_brew_installed_taps() {
 10+  installed_taps=(`brew tap`)
 11+}
 12+
 13+_brew_outdated_formulae() {
 14+  outdated_formulae=(`brew outdated`)
 15+}
 16+
 17+_brew_running_services() {
 18+  running_services=(`brew services list | awk '{print $1}'`)
 19+}
 20+
 21 local -a _1st_arguments
 22 _1st_arguments=(
 23+  'audit:check formulae for Homebrew coding style'
 24+  'bundle:look for a Brewfile and run each line as a brew command'
 25   'cat:display formula file for a formula'
 26   'cleanup:uninstall unused and old versions of packages'
 27+  'commands:show a list of commands'
 28   'create:create a new formula'
 29   'deps:list dependencies and dependants of a formula'
 30   'doctor:audits your installation for common issues'
 31@@ -22,27 +37,38 @@ _1st_arguments=(
 32   'home:visit the homepage of a formula or the brew project'
 33   'info:information about a formula'
 34   'install:install a formula'
 35+  'reinstall:install a formula anew; re-using its current options'
 36   'link:link a formula'
 37   'list:list files in a formula or not-installed formulae'
 38   'log:git commit log for a formula'
 39   'missing:check all installed formuale for missing dependencies.'
 40-  'options:display install options specific to formula.'
 41-  'outdated:list formulas for which a newer version is available'
 42+  'outdated:list formulae for which a newer version is available'
 43+  'pin:pin specified formulae'
 44   'prune:remove dead links'
 45-  'reinstall:reinstall a formula'
 46   'remove:remove a formula'
 47   'search:search for a formula (/regex/ or string)'
 48   'server:start a local web app that lets you browse formulae (requires Sinatra)'
 49-  'services:manage background services via launchctl'
 50+  'services:small wrapper around `launchctl` for supported formulae'
 51+  'tap:tap a new formula repository from GitHub, or list existing taps'
 52   'unlink:unlink a formula'
 53+  'unpin:unpin specified formulae'
 54+  'untap:remove a tapped repository'
 55   'update:freshen up links'
 56   'upgrade:upgrade outdated formulae'
 57-  'uses:show formulas which depend on a formula'
 58-  'versions:show all available formula versions'
 59+  'uses:show formulae which depend on a formula'
 60+)
 61+
 62+local -a _service_arguments
 63+_service_arguments=(
 64+  'cleanup:get rid of stale services and unused plists'
 65+  'list:list all services managed by `brew services`'
 66+  'restart:gracefully restart selected service'
 67+  'start:start selected service'
 68+  'stop:stop selected service'
 69 )
 70 
 71 local expl
 72-local -a formulae installed_formulae
 73+local -a formulae installed_formulae installed_taps outdated_formulae running_services
 74 
 75 _arguments \
 76   '(-v)-v[verbose]' \
 77@@ -61,24 +87,41 @@ if (( CURRENT == 1 )); then
 78 fi
 79 
 80 case "$words[1]" in
 81-  search|-S)
 82-    _arguments \
 83-      '(--macports)--macports[search the macports repository]' \
 84-      '(--fink)--fink[search the fink repository]' ;;
 85+  install|reinstall|audit|home|homepage|log|info|abv|uses|cat|deps|edit|options)
 86+    _brew_all_formulae
 87+    _wanted formulae expl 'all formulae' compadd -a formulae ;;
 88   list|ls)
 89     _arguments \
 90       '(--unbrewed)--unbrewed[files in brew --prefix not controlled by brew]' \
 91+      '(--pinned)--pinned[list all versions of pinned formulae]' \
 92       '(--versions)--versions[list all installed versions of a formula]' \
 93-      '1: :->forms' &&  return 0
 94+      '1: :->forms' && return 0
 95 
 96       if [[ "$state" == forms ]]; then
 97         _brew_installed_formulae
 98         _wanted installed_formulae expl 'installed formulae' compadd -a installed_formulae
 99       fi ;;
100-  install|home|homepage|log|info|abv|uses|cat|deps|edit|options|versions)
101-    _brew_all_formulae
102-    _wanted formulae expl 'all formulae' compadd -a formulae ;;
103-  reinstall|remove|rm|uninstall|unlink|cleanup|link|ln)
104+  remove|rm|uninstall|unlink|cleanup|link|ln|pin|unpin)