diff options
| author | George Kulakowski | 2011-02-08 21:04:54 -0500 |
|---|---|---|
| committer | Adam Vandenberg | 2011-02-13 19:45:41 -0800 |
| commit | 2fb68be78d8ff4214e4bdb835bc1763e347af60d (patch) | |
| tree | f3a94a854573439adb5d6963436b9d3866999681 | |
| parent | 2b88c24ead4c7da4f083174be313e654fa1a9d2e (diff) | |
| download | brew-2fb68be78d8ff4214e4bdb835bc1763e347af60d.tar.bz2 | |
Clean up zsh completion
1. Fix a misspelled variable to avoid shell namespace pollution
2. Remove a bogus completion (the 'brew xo' one)
3. Add missing tab completion code for
- Several arguments/commands (options, --cellar etc.)
- Aliases (e.g. home and homepage)
- 'brew edit' complete to all formulae, not just installed ones
Signed-off-by: Adam Vandenberg <flangy@gmail.com>
| -rw-r--r-- | Library/Contributions/brew_zsh_completion.zsh | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/Library/Contributions/brew_zsh_completion.zsh b/Library/Contributions/brew_zsh_completion.zsh index aa728e113..6e2bb6e12 100644 --- a/Library/Contributions/brew_zsh_completion.zsh +++ b/Library/Contributions/brew_zsh_completion.zsh @@ -40,10 +40,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]' \ @@ -55,7 +59,11 @@ 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]' \ @@ -65,10 +73,10 @@ case "$words[1]" in _brew_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 |
