Skip to content
Snippets Groups Projects
Commit 2fb68be7 authored by George Kulakowski's avatar George Kulakowski Committed by Adam Vandenberg
Browse files

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: default avatarAdam Vandenberg <flangy@gmail.com>
parent 2b88c24e
No related branches found
No related tags found
No related merge requests found
......@@ -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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment