From 2fb68be78d8ff4214e4bdb835bc1763e347af60d Mon Sep 17 00:00:00 2001 From: George Kulakowski Date: Tue, 8 Feb 2011 21:04:54 -0500 Subject: [PATCH] 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 --- Library/Contributions/brew_zsh_completion.zsh | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/Library/Contributions/brew_zsh_completion.zsh b/Library/Contributions/brew_zsh_completion.zsh index aa728e1139..6e2bb6e129 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