Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
tree: 387130e965
Fetching contributors…

Cannot retrieve contributors at this time

74 lines (66 sloc) 2.561 kb
# vim: set ft=sh:
_local_packages()
{
pacman -Qq
}
_sync_packages()
{
pacman -Ssq "$@"
}
_aur_packages()
{
cower -sq "$@" 2> /dev/null
}
_owl()
{
COMPREPLY=()
if [[ $COMP_CWORD -ge 1 ]] ; then
local current_word="${COMP_WORDS[COMP_CWORD]}"
case $current_word in
--*)
local long_opts='--aur --repo --local --ignore-outdated --recursive --cascade --dependencies --quiet --crawl-homes'
COMPREPLY=( $(compgen -W "$long_opts" -- "$current_word") )
return 0
;;
-*)
local short_opts='-a -o -l -i -s -c -d -q -w'
COMPREPLY=( $(compgen -W "$short_opts" -- "$current_word") )
return 0
;;
esac
if [[ $COMP_CWORD -eq 1 ]] ; then
local actions='refresh update pull install upgrade downgrade check remove uninstall download info deps uses page home search query list lsgrep binlist liblist etclist manlist doclist grep version repository description category license owns cleanup last leftovers foreigns orphans'
COMPREPLY=( $(compgen -W "$actions" -- "$current_word") )
return 0
else
local second_word=${COMP_WORDS[1]}
local packages=""
case $second_word in
list | lsgrep | binlist | liblist | etclist | manlist | doclist | grep | upgrade | downgrade | check | remove | uninstall | deps | uses)
[[ $second_word == grep && $COMP_CWORD -eq 2 ]] && return 0
[[ $second_word == lsgrep && $COMP_CWORD -eq 2 ]] && return 0
packages="$(_local_packages)"
;;
install | info | home | version | description | license)
packages="$(_sync_packages "$current_word"; _aur_packages "$current_word")"
;;
download | page | category)
packages="$(_aur_packages "$current_word")"
;;
repository)
packages="$(_sync_packages "$current_word")"
;;
owns)
compopt -o filenames
COMPREPLY=( $(compgen -f "$current_word") )
return 0
;;
esac
if [[ -n "$packages" ]] ; then
COMPREPLY=( $(compgen -W "$packages" -- "$current_word") )
return 0
fi
fi
fi
}
complete -F _owl owl
Jump to Line
Something went wrong with that request. Please try again.