2010-07-19 09:51:28 -07:00
|
|
|
# Bash completion script for brew(1)
|
2009-09-05 20:47:15 +01:00
|
|
|
#
|
2012-01-21 00:08:35 -06:00
|
|
|
# To use, add the following to your .bashrc:
|
|
|
|
#
|
|
|
|
# . $(brew --repository)/Library/Contributions/brew_bash_completion.sh
|
|
|
|
#
|
|
|
|
# Alternatively, if you have installed the bash-completion package,
|
|
|
|
# you can create a symlink to this file in one of the following directories:
|
|
|
|
#
|
|
|
|
# $(brew --prefix)/etc/bash_completion.d
|
|
|
|
# $(brew --prefix)/share/bash-completion/completions
|
|
|
|
#
|
2012-03-29 19:59:35 -05:00
|
|
|
# Installing to etc/bash_completion.d will cause bash-completion to load
|
|
|
|
# it automatically at shell startup time. If you choose to install it to
|
|
|
|
# share/bash-completion/completions, it will be loaded on-demand (i.e. the
|
|
|
|
# first time you invoke the `brew` command in a shell session).
|
2009-07-31 09:45:04 -07:00
|
|
|
|
2012-01-21 00:08:35 -06:00
|
|
|
__brewcomp_words_include ()
|
|
|
|
{
|
2012-03-16 19:09:24 -05:00
|
|
|
local i=1
|
|
|
|
while [[ $i -lt $COMP_CWORD ]]; do
|
|
|
|
if [[ "${COMP_WORDS[i]}" = "$1" ]]; then
|
|
|
|
return 0
|
|
|
|
fi
|
|
|
|
i=$((++i))
|
|
|
|
done
|
|
|
|
return 1
|
2012-01-21 00:08:35 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
# Find the previous non-switch word
|
|
|
|
__brewcomp_prev ()
|
|
|
|
{
|
2012-03-16 19:09:24 -05:00
|
|
|
local idx=$((COMP_CWORD - 1))
|
|
|
|
local prv="${COMP_WORDS[idx]}"
|
|
|
|
while [[ $prv == -* ]]; do
|
|
|
|
idx=$((--idx))
|
|
|
|
prv="${COMP_WORDS[idx]}"
|
|
|
|
done
|
|
|
|
echo "$prv"
|
2012-01-21 00:08:35 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
__brewcomp ()
|
|
|
|
{
|
2012-03-16 19:09:24 -05:00
|
|
|
# break $1 on space, tab, and newline characters,
|
|
|
|
# and turn it into a newline separated list of words
|
|
|
|
local list s sep=$'\n' IFS=$' '$'\t'$'\n'
|
|
|
|
local cur="${COMP_WORDS[COMP_CWORD]}"
|
|
|
|
|
|
|
|
for s in $1; do
|
|
|
|
__brewcomp_words_include "$s" && continue
|
|
|
|
list="$list$s$sep"
|
|
|
|
done
|
|
|
|
|
|
|
|
IFS=$sep
|
|
|
|
COMPREPLY=($(compgen -W "$list" -- "$cur"))
|
2012-01-21 00:08:35 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
# Don't use __brewcomp() in any of the __brew_complete_foo functions, as
|
|
|
|
# it is too slow and is not worth it just for duplicate elimination.
|
|
|
|
__brew_complete_formulae ()
|
|
|
|
{
|
2012-03-16 19:09:24 -05:00
|
|
|
local cur="${COMP_WORDS[COMP_CWORD]}"
|
2013-04-30 01:24:11 -05:00
|
|
|
local lib=$(brew --repository)/Library
|
2014-04-14 22:32:24 -05:00
|
|
|
local taps=${lib}/Taps
|
2013-04-30 01:24:11 -05:00
|
|
|
local ff=$(\ls ${lib}/Formula 2>/dev/null | sed 's/\.rb//g')
|
2014-04-14 22:15:05 -05:00
|
|
|
local af=$(\ls ${lib}/Aliases 2>/dev/null)
|
2014-04-14 22:32:24 -05:00
|
|
|
local tf file
|
2012-03-16 19:11:30 -05:00
|
|
|
|
2014-04-24 17:24:27 -05:00
|
|
|
for file in ${taps}/*/*/*.rb ${taps}/*/*/Formula/*.rb ${taps}/*/*/HomebrewFormula/*.rb; do
|
2014-04-24 21:36:59 -05:00
|
|
|
[ -f "$file" ] || continue
|
2014-04-14 22:32:24 -05:00
|
|
|
file=${file/"Formula/"/}
|
|
|
|
file=${file/"HomebrewFormula/"/}
|
|
|
|
file=${file#${lib}/Taps/}
|
|
|
|
file=${file%.rb}
|
2014-04-24 17:24:27 -05:00
|
|
|
file=${file/homebrew-/}
|
2014-04-14 22:32:24 -05:00
|
|
|
tf="${tf} ${file}"
|
2012-03-16 19:11:30 -05:00
|
|
|
done
|
|
|
|
|
|
|
|
COMPREPLY=($(compgen -W "$ff $af $tf" -- "$cur"))
|
2012-01-21 00:08:35 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
__brew_complete_installed ()
|
|
|
|
{
|
2012-03-16 19:09:24 -05:00
|
|
|
local cur="${COMP_WORDS[COMP_CWORD]}"
|
|
|
|
local inst=$(\ls $(brew --cellar))
|
|
|
|
COMPREPLY=($(compgen -W "$inst" -- "$cur"))
|
2012-01-21 00:08:35 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
__brew_complete_outdated ()
|
|
|
|
{
|
2012-03-16 19:09:24 -05:00
|
|
|
local cur="${COMP_WORDS[COMP_CWORD]}"
|
|
|
|
local od=$(brew outdated --quiet)
|
|
|
|
COMPREPLY=($(compgen -W "$od" -- "$cur"))
|
2012-01-21 00:08:35 -06:00
|
|
|
}
|
|
|
|
|
2013-12-08 02:40:09 -05:00
|
|
|
__brew_complete_versions ()
|
|
|
|
{
|
|
|
|
local formula="$1"
|
|
|
|
local versions=$(brew list --versions "$formula")
|
|
|
|
local cur="${COMP_WORDS[COMP_CWORD]}"
|
|
|
|
COMPREPLY=($(compgen -W "$versions" -X "$formula" -- "$cur"))
|
|
|
|
}
|
|
|
|
|
|
|
|
_brew_switch ()
|
|
|
|
{
|
|
|
|
case "$COMP_CWORD" in
|
|
|
|
2) __brew_complete_installed ;;
|
|
|
|
3) __brew_complete_versions "${COMP_WORDS[COMP_CWORD-1]}" ;;
|
|
|
|
*) ;;
|
|
|
|
esac
|
|
|
|
}
|
|
|
|
|
2012-03-23 22:42:43 -05:00
|
|
|
__brew_complete_tapped ()
|
2012-03-16 16:52:35 -05:00
|
|
|
{
|
2014-04-24 17:24:27 -05:00
|
|
|
local taplib=$(brew --repository)/Library/Taps
|
|
|
|
local dir taps
|
|
|
|
|
|
|
|
for dir in ${taplib}/*/*; do
|
2014-04-24 21:36:59 -05:00
|
|
|
[ -d "$dir" ] || continue
|
2014-04-24 17:24:27 -05:00
|
|
|
dir=${dir#${taplib}/}
|
|
|
|
dir=${dir/homebrew-/}
|
|
|
|
taps="$taps $dir"
|
|
|
|
done
|
|
|
|
__brewcomp "$taps"
|
2012-03-16 16:52:35 -05:00
|
|
|
}
|
|
|
|
|
2013-04-10 18:20:48 -03:00
|
|
|
_brew_complete_tap ()
|
|
|
|
{
|
|
|
|
local cur="${COMP_WORDS[COMP_CWORD]}"
|
|
|
|
case "$cur" in
|
|
|
|
--*)
|
|
|
|
__brewcomp "--repair"
|
|
|
|
return
|
|
|
|
;;
|
|
|
|
esac
|
2012-03-23 22:42:43 -05:00
|
|
|
}
|
|
|
|
|
2014-03-29 22:26:03 -05:00
|
|
|
_brew_bottle ()
|
|
|
|
{
|
|
|
|
local cur="${COMP_WORDS[COMP_CWORD]}"
|
|
|
|
case "$cur" in
|
|
|
|
--*)
|
2014-05-09 17:38:12 +09:00
|
|
|
__brewcomp "--merge --rb --write --root_url="
|
2014-03-29 22:26:03 -05:00
|
|
|
return
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
__brew_complete_installed
|
|
|
|
}
|
|
|
|
|
2012-01-21 00:08:35 -06:00
|
|
|
_brew_cleanup ()
|
|
|
|
{
|
2012-03-16 19:09:24 -05:00
|
|
|
local cur="${COMP_WORDS[COMP_CWORD]}"
|
|
|
|
case "$cur" in
|
|
|
|
--*)
|
|
|
|
__brewcomp "--force"
|
|
|
|
return
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
__brew_complete_installed
|
2012-01-21 00:08:35 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
_brew_create ()
|
|
|
|
{
|
2012-03-16 19:09:24 -05:00
|
|
|
local cur="${COMP_WORDS[COMP_CWORD]}"
|
|
|
|
case "$cur" in
|
|
|
|
--*)
|
2012-11-13 16:50:19 -06:00
|
|
|
__brewcomp "--autotools --cmake --no-fetch --set-name --set-version"
|
2012-03-16 19:09:24 -05:00
|
|
|
return
|
|
|
|
;;
|
|
|
|
esac
|
2012-01-21 00:08:35 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
_brew_deps ()
|
|
|
|
{
|
2012-03-16 19:09:24 -05:00
|
|
|
local cur="${COMP_WORDS[COMP_CWORD]}"
|
|
|
|
case "$cur" in
|
|
|
|
--*)
|
|
|
|
__brewcomp "--1 --all --tree"
|
|
|
|
return
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
__brew_complete_formulae
|
2012-01-21 00:08:35 -06:00
|
|
|
}
|
|
|
|
|
2012-11-13 16:49:43 -06:00
|
|
|
_brew_doctor () {
|
|
|
|
local cur="${COMP_WORDS[COMP_CWORD]}"
|
|
|
|
__brewcomp "$(brew doctor --list-checks)"
|
|
|
|
}
|
|
|
|
|
2012-01-21 00:08:35 -06:00
|
|
|
_brew_diy ()
|
|
|
|
{
|
2012-03-16 19:09:24 -05:00
|
|
|
local cur="${COMP_WORDS[COMP_CWORD]}"
|
|
|
|
case "$cur" in
|
|
|
|
--*)
|
|
|
|
__brewcomp "--set-name --set-version"
|
|
|
|
return
|
|
|
|
;;
|
|
|
|
esac
|
2012-01-21 00:08:35 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
_brew_fetch ()
|
|
|
|
{
|
2012-03-16 19:09:24 -05:00
|
|
|
local cur="${COMP_WORDS[COMP_CWORD]}"
|
2013-06-12 15:57:58 -07:00
|
|
|
local prv=$(__brewcomp_prev)
|
2012-03-16 19:09:24 -05:00
|
|
|
case "$cur" in
|
|
|
|
--*)
|
2013-06-12 15:57:58 -07:00
|
|
|
__brewcomp "
|
|
|
|
--deps --force
|
|
|
|
--devel --HEAD
|
2014-03-15 10:09:17 -05:00
|
|
|
--build-from-source --force-bottle --build-bottle
|
|
|
|
--retry
|
2013-06-12 15:57:58 -07:00
|
|
|
$(brew options --compact "$prv" 2>/dev/null)
|
|
|
|
"
|
2012-03-16 19:09:24 -05:00
|
|
|
return
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
__brew_complete_formulae
|
2012-01-21 00:08:35 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
_brew_info ()
|
|
|
|
{
|
2012-03-16 19:09:24 -05:00
|
|
|
local cur="${COMP_WORDS[COMP_CWORD]}"
|
|
|
|
case "$cur" in
|
|
|
|
--*)
|
2014-05-16 08:47:09 -07:00
|
|
|
__brewcomp "--all --github --installed --json=v1"
|
2012-03-16 19:09:24 -05:00
|
|
|
return
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
__brew_complete_formulae
|
2012-01-21 00:08:35 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
_brew_install ()
|
|
|
|
{
|
2012-03-16 19:09:24 -05:00
|
|
|
local cur="${COMP_WORDS[COMP_CWORD]}"
|
|
|
|
local prv=$(__brewcomp_prev)
|
|
|
|
|
|
|
|
case "$cur" in
|
|
|
|
--*)
|
|
|
|
if __brewcomp_words_include "--interactive"; then
|
2014-03-15 10:09:17 -05:00
|
|
|
__brewcomp "--devel --git --HEAD"
|
2012-03-16 19:09:24 -05:00
|
|
|
else
|
|
|
|
__brewcomp "
|
2014-03-15 10:09:17 -05:00
|
|
|
--build-from-source --build-bottle --force-bottle
|
2012-03-16 19:09:24 -05:00
|
|
|
--debug
|
|
|
|
--devel
|
|
|
|
--HEAD
|
|
|
|
--ignore-dependencies
|
|
|
|
--interactive
|
2013-12-16 16:37:59 -08:00
|
|
|
--only-dependencies
|
2012-03-16 19:09:24 -05:00
|
|
|
--verbose
|
2013-05-25 18:28:08 -05:00
|
|
|
$(brew options --compact "$prv" 2>/dev/null)
|
2012-03-16 19:09:24 -05:00
|
|
|
"
|
|
|
|
fi
|
|
|
|
return
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
__brew_complete_formulae
|
2012-01-21 00:08:35 -06:00
|
|
|
}
|
|
|
|
|
2012-07-11 20:08:09 -07:00
|
|
|
_brew_link ()
|
|
|
|
{
|
|
|
|
local cur="${COMP_WORDS[COMP_CWORD]}"
|
|
|
|
case "$cur" in
|
|
|
|
--*)
|
2013-05-15 08:42:54 +02:00
|
|
|
__brewcomp "--dry-run --overwrite --force"
|
2012-11-13 16:50:19 -06:00
|
|
|
return
|
2012-07-11 20:08:09 -07:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
__brew_complete_installed
|
|
|
|
}
|
|
|
|
|
2014-04-06 14:05:23 -07:00
|
|
|
_brew_linkapps ()
|
|
|
|
{
|
|
|
|
local cur="${COMP_WORDS[COMP_CWORD]}"
|
|
|
|
case "$cur" in
|
|
|
|
--*)
|
|
|
|
__brewcomp "--local"
|
|
|
|
return
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
}
|
|
|
|
|
2012-01-21 00:08:35 -06:00
|
|
|
_brew_list ()
|
|
|
|
{
|
2012-03-16 19:09:24 -05:00
|
|
|
local cur="${COMP_WORDS[COMP_CWORD]}"
|
|
|
|
case "$cur" in
|
|
|
|
--*)
|
|
|
|
# options to brew-list are mutually exclusive
|
|
|
|
if __brewcomp_words_include "--unbrewed"; then
|
|
|
|
return
|
|
|
|
elif __brewcomp_words_include "--verbose"; then
|
|
|
|
return
|
2013-03-11 16:41:08 +01:00
|
|
|
elif __brewcomp_words_include "--pinned"; then
|
|
|
|
return
|
2012-03-16 19:09:24 -05:00
|
|
|
elif __brewcomp_words_include "--versions"; then
|
|
|
|
return
|
|
|
|
else
|
2013-03-11 16:41:08 +01:00
|
|
|
__brewcomp "--unbrewed --verbose --pinned --versions"
|
2012-03-16 19:09:24 -05:00
|
|
|
return
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
__brew_complete_installed
|
2012-01-21 00:08:35 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
_brew_log ()
|
|
|
|
{
|
2012-03-16 19:09:24 -05:00
|
|
|
# if git-completion is loaded, then we complete git-log options
|
|
|
|
declare -F _git_log >/dev/null || return
|
|
|
|
local cur="${COMP_WORDS[COMP_CWORD]}"
|
|
|
|
case "$cur" in
|
|
|
|
--*)
|
|
|
|
__brewcomp "
|
|
|
|
$__git_log_common_options
|
|
|
|
$__git_log_shortlog_options
|
|
|
|
$__git_log_gitk_options
|
|
|
|
$__git_diff_common_options
|
|
|
|
--walk-reflogs --graph --decorate
|
|
|
|
--abbrev-commit --oneline --reverse
|
|
|
|
"
|
|
|
|
return
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
__brew_complete_formulae
|
2012-01-21 00:08:35 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
_brew_options ()
|
|
|
|
{
|
2012-03-16 19:09:24 -05:00
|
|
|
local cur="${COMP_WORDS[COMP_CWORD]}"
|
|
|
|
case "$cur" in
|
|
|
|
--*)
|
|
|
|
__brewcomp "--all --compact --installed"
|
|
|
|
return
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
__brew_complete_formulae
|
2012-01-21 00:08:35 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
_brew_outdated ()
|
|
|
|
{
|
2012-03-16 19:09:24 -05:00
|
|
|
local cur="${COMP_WORDS[COMP_CWORD]}"
|
|
|
|
case "$cur" in
|
|
|
|
--*)
|
|
|
|
__brewcomp "--quiet"
|
|
|
|
return
|
|
|
|
;;
|
|
|
|
esac
|
2012-01-21 00:08:35 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
_brew_search ()
|
|
|
|
{
|
2012-03-16 19:09:24 -05:00
|
|
|
local cur="${COMP_WORDS[COMP_CWORD]}"
|
|
|
|
case "$cur" in
|
|
|
|
--*)
|
2013-08-17 08:56:12 -07:00
|
|
|
__brewcomp "--debian --fedora --fink --macports --opensuse --ubuntu"
|
2012-03-16 19:09:24 -05:00
|
|
|
return
|
|
|
|
;;
|
|
|
|
esac
|
2012-01-21 00:08:35 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
_brew_uninstall ()
|
|
|
|
{
|
2012-03-16 19:09:24 -05:00
|
|
|
local cur="${COMP_WORDS[COMP_CWORD]}"
|
|
|
|
case "$cur" in
|
|
|
|
--*)
|
|
|
|
__brewcomp "--force"
|
|
|
|
return
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
__brew_complete_installed
|
2012-01-21 00:08:35 -06:00
|
|
|
}
|
|
|
|
|
2014-05-17 17:12:40 -05:00
|
|
|
_brew_unpack ()
|
|
|
|
{
|
|
|
|
local cur="${COMP_WORDS[COMP_CWORD]}"
|
|
|
|
case "$cur" in
|
|
|
|
--*)
|
|
|
|
__brewcomp "--git --patch --destdir="
|
|
|
|
return
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
__brew_complete_formulae
|
|
|
|
}
|
2012-01-21 00:08:35 -06:00
|
|
|
_brew_update ()
|
|
|
|
{
|
2012-03-16 19:09:24 -05:00
|
|
|
local cur="${COMP_WORDS[COMP_CWORD]}"
|
|
|
|
case "$cur" in
|
|
|
|
--*)
|
|
|
|
__brewcomp "--rebase --verbose"
|
|
|
|
return
|
|
|
|
;;
|
|
|
|
esac
|
2012-01-21 00:08:35 -06:00
|
|
|
}
|
|
|
|
|
2014-03-15 10:09:17 -05:00
|
|
|
_brew_upgrade ()
|
|
|
|
{
|
|
|
|
local cur="${COMP_WORDS[COMP_CWORD]}"
|
|
|
|
local prv=$(__brewcomp_prev)
|
|
|
|
|
|
|
|
case "$cur" in
|
|
|
|
--*)
|
|
|
|
__brewcomp "
|
|
|
|
--build-from-source --build-bottle --force-bottle
|
|
|
|
--debug
|
|
|
|
--verbose
|
|
|
|
"
|
|
|
|
return
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
__brew_complete_outdated
|
|
|
|
}
|
|
|
|
|
2012-01-21 00:08:35 -06:00
|
|
|
_brew_uses ()
|
|
|
|
{
|
2012-03-16 19:09:24 -05:00
|
|
|
local cur="${COMP_WORDS[COMP_CWORD]}"
|
|
|
|
case "$cur" in
|
|
|
|
--*)
|
2012-11-13 16:50:19 -06:00
|
|
|
__brewcomp "--installed --recursive"
|
2012-03-16 19:09:24 -05:00
|
|
|
return
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
__brew_complete_formulae
|
2012-01-21 00:08:35 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
_brew_versions ()
|
|
|
|
{
|
2012-03-16 19:09:24 -05:00
|
|
|
local cur="${COMP_WORDS[COMP_CWORD]}"
|
|
|
|
case "$cur" in
|
|
|
|
--*)
|
|
|
|
__brewcomp "--compact"
|
|
|
|
return
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
__brew_complete_formulae
|
2009-07-28 01:45:17 -07:00
|
|
|
}
|
|
|
|
|
2012-01-21 00:08:35 -06:00
|
|
|
_brew ()
|
|
|
|
{
|
2012-03-16 19:09:24 -05:00
|
|
|
local i=1 cmd
|
|
|
|
|
|
|
|
# find the subcommand
|
|
|
|
while [[ $i -lt $COMP_CWORD ]]; do
|
|
|
|
local s="${COMP_WORDS[i]}"
|
|
|
|
case "$s" in
|
|
|
|
--*)
|
|
|
|
cmd="$s"
|
|
|
|
break
|
|
|
|
;;
|
|
|
|
-*)
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
cmd="$s"
|
|
|
|
break
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
i=$((++i))
|
|
|
|
done
|
|
|
|
|
|
|
|
if [[ $i -eq $COMP_CWORD ]]; then
|
2013-02-17 13:32:15 +00:00
|
|
|
local ext=$(\ls -p $(brew --repository)/Library/Contributions/cmd \
|
2012-07-17 22:09:47 -05:00
|
|
|
2>/dev/null | sed -e "s/\.rb//g" -e "s/brew-//g" \
|
2012-07-18 08:25:07 -05:00
|
|
|
-e "s/.*\///g")
|
2012-03-16 19:09:24 -05:00
|
|
|
__brewcomp "
|
2014-05-01 16:40:55 -05:00
|
|
|
--cache --cellar
|
2012-03-16 19:09:24 -05:00
|
|
|
--env --prefix --repository
|
|
|
|
audit
|
|
|
|
cat
|
|
|
|
cleanup
|
2013-09-14 16:58:26 -07:00
|
|
|
commands
|
2014-05-01 16:40:55 -05:00
|
|
|
config --config
|
2012-03-16 19:09:24 -05:00
|
|
|
create
|
|
|
|
deps
|
|
|
|
diy configure
|
|
|
|
doctor
|
|
|
|
edit
|
|
|
|
fetch
|
|
|
|
help
|
|
|
|
home
|
|
|
|
info abv
|
|
|
|
install
|
2013-10-29 21:07:21 -07:00
|
|
|
linkapps
|
2012-07-12 02:41:12 -05:00
|
|
|
link ln
|
2012-03-16 19:09:24 -05:00
|
|
|
list ls
|
|
|
|
log
|
2012-06-13 08:12:41 -05:00
|
|
|
missing
|
2012-03-16 19:09:24 -05:00
|
|
|
options
|
|
|
|
outdated
|
|
|
|
prune
|
2013-03-11 16:41:08 +01:00
|
|
|
pin
|
2012-03-16 19:09:24 -05:00
|
|
|
search
|
2013-08-21 12:57:16 -04:00
|
|
|
reinstall
|
2012-03-16 19:09:24 -05:00
|
|
|
tap
|
|
|
|
test
|
|
|
|
uninstall remove rm
|
|
|
|
unlink
|
2013-10-29 21:07:21 -07:00
|
|
|
unlinkapps
|
2013-03-11 16:41:08 +01:00
|
|
|
unpin
|
2012-03-16 19:09:24 -05:00
|
|
|
untap
|
|
|
|
update
|
|
|
|
upgrade
|
|
|
|
uses
|
|
|
|
versions
|
|
|
|
$ext
|
|
|
|
"
|
|
|
|
return
|
|
|
|
fi
|
|
|
|
|
|
|
|
# subcommands have their own completion functions
|
|
|
|
case "$cmd" in
|
|
|
|
--cache|--cellar|--prefix) __brew_complete_formulae ;;
|
|
|
|
audit|cat|edit|home) __brew_complete_formulae ;;
|
2012-07-11 20:08:09 -07:00
|
|
|
test|unlink) __brew_complete_installed ;;
|
2014-03-29 22:26:03 -05:00
|
|
|
bottle) _brew_bottle ;;
|
2012-03-16 19:09:24 -05:00
|
|
|
cleanup) _brew_cleanup ;;
|
|
|
|
create) _brew_create ;;
|
|
|
|
deps) _brew_deps ;;
|
2012-11-13 16:49:43 -06:00
|
|
|
doctor|dr) _brew_doctor ;;
|
2012-03-16 19:09:24 -05:00
|
|
|
diy|configure) _brew_diy ;;
|
|
|
|
fetch) _brew_fetch ;;
|
|
|
|
info|abv) _brew_info ;;
|
2014-03-15 10:09:17 -05:00
|
|
|
install|instal|reinstall) _brew_install ;;
|
2012-07-11 20:08:09 -07:00
|
|
|
link|ln) _brew_link ;;
|
2014-04-06 14:05:23 -07:00
|
|
|
linkapps) _brew_linkapps ;;
|
2012-03-16 19:09:24 -05:00
|
|
|
list|ls) _brew_list ;;
|
|
|
|
log) _brew_log ;;
|
2012-06-13 08:12:41 -05:00
|
|
|
missing) __brew_complete_formulae ;;
|
2012-03-16 19:09:24 -05:00
|
|
|
options) _brew_options ;;
|
|
|
|
outdated) _brew_outdated ;;
|
2013-03-30 22:45:19 +01:00
|
|
|
pin) __brew_complete_formulae ;;
|
2012-03-16 19:09:24 -05:00
|
|
|
search|-S) _brew_search ;;
|
2013-12-08 02:40:09 -05:00
|
|
|
switch) _brew_switch ;;
|
2013-04-10 18:20:48 -03:00
|
|
|
tap) _brew_complete_tap ;;
|
2012-03-16 19:09:24 -05:00
|
|
|
uninstall|remove|rm) _brew_uninstall ;;
|
2014-05-17 17:12:40 -05:00
|
|
|
unpack) _brew_unpack ;;
|
2013-03-11 16:41:08 +01:00
|
|
|
unpin) __brew_complete_formulae ;;
|
2012-03-23 22:42:43 -05:00
|
|
|
untap) __brew_complete_tapped ;;
|
2012-03-16 19:09:24 -05:00
|
|
|
update) _brew_update ;;
|
2014-03-15 10:09:17 -05:00
|
|
|
upgrade) _brew_upgrade ;;
|
2012-03-16 19:09:24 -05:00
|
|
|
uses) _brew_uses ;;
|
|
|
|
versions) _brew_versions ;;
|
|
|
|
*) ;;
|
|
|
|
esac
|
2012-01-21 00:08:35 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
# keep around for compatibility
|
|
|
|
_brew_to_completion ()
|
|
|
|
{
|
2012-03-16 19:09:24 -05:00
|
|
|
_brew
|
2012-01-21 00:08:35 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
complete -o bashdefault -o default -F _brew brew
|