Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

104 lines (91 sloc) 2.833 kB
#compdef cower
typeset -A opt_args
'-d[Download target(s)]'
'-i[Show info for target(s)]'
'-m[Show packages maintained by target(s)]'
'-s[Search for target(s)]'
'-u[Check for updates against AUR]'
'-h[Display usage]'
'-f[Overwrite existing files when downloading]'
'*--ignore[Ignore a package upgrade]:package:
'*--ignorerepo[Ignore some or all binary repos]:repositories:
'--nossl[Do not use https connections]'
'-t[Specify an alternate download directory]:target:_files -/'
'--threads[Limit number of threads created]:number of threads'
'--timeout[Specify connection timeout in seconds]:timeout'
'-c[Use colored output]'
'--debug[Show debug output]'
'-q[Output less]'
'-v[Output more]'
_cower_action_none() {
_arguments -s -w : \
# provides completions for installed packages
_cower_completions_installed_packages() {
local -a cmd packages packages_long
packages=( ${${packages_long#/var/lib/pacman/local/}%-*-*} )
compadd "$@" -a packages
_cower_completions_repositories() {
local -a cmd repositories
# Uniq the array
typeset -U repositories
compadd "$@" -a repositories
_cower_completions_aur() {
local -a aur_packages
aur_packages=($(_call_program packages $service -sq $words[CURRENT] 2>/dev/null))
compadd "$@" -a aur_packages
_cower_completions_format() {
arguments=(%c %d %i %l %n %o %p %t %u %v %%)
if [[ $words = *-i*i* ]]; then
arguments+=(%C %D %M %O %P %R)
compadd "$@" -a arguments
_cower() {
case $words[2] in
-[ms]*) _arguments -s -w : \
"$_cower_opts_general[@]" \
"$_cower_opts_output[@]" \
'--format[Print package output according to format string]:string:
-i*) _arguments -s -w : \
"$_cower_opts_general[@]" \
"$_cower_opts_output[@]" \
'*-i[Show more info]' \
'*:package:_cower_completions_aur' \
'--listdelim[Change list format delimeter]' \
'--format[Print package output according to format string]:string:
-d*) _arguments -s -w : \
"$_cower_opts_general[@]" \
"$_cower_opts_output[@]" \
'*-d[Download AUR dependencies]' \
-u*) _arguments -s -w : \
"$_cower_opts_general[@]" \
"$_cower_opts_output[@]" \
'*-d[Download updates]'
-) _cower_action_none ;;
*) return 1 ;;
_cower "$@"
# vim: set et sw=2 ts=2 ft=zsh :
Jump to Line
Something went wrong with that request. Please try again.