Merge pull request #97 from luolimao/master
AUR/Pactree package completion
This commit is contained in:
commit
9966dd96a0
|
@ -0,0 +1,26 @@
|
||||||
|
#compdef pactree
|
||||||
|
# ------------------------------------------------------------------------------
|
||||||
|
# Description
|
||||||
|
# -----------
|
||||||
|
#
|
||||||
|
# Completion script for pactree 4.0
|
||||||
|
#
|
||||||
|
# ------------------------------------------------------------------------------
|
||||||
|
# Authors
|
||||||
|
# -------
|
||||||
|
#
|
||||||
|
# * Limao Luo <luolimao@gmail.com>
|
||||||
|
#
|
||||||
|
# ------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
typeset -A opt_args
|
||||||
|
|
||||||
|
_pactree() {
|
||||||
|
local -a cmd packages packages_long
|
||||||
|
packages_long=(/var/lib/pacman/local/*(/))
|
||||||
|
packages=( ${${packages_long#/var/lib/pacman/local/}%-*-*} )
|
||||||
|
compadd "$@" -a packages
|
||||||
|
}
|
||||||
|
|
||||||
|
# run the main dispatcher
|
||||||
|
_pactree "$@"
|
|
@ -137,10 +137,16 @@ _yaourt_completions_all_packages() {
|
||||||
if compset -P1 '*/*'; then
|
if compset -P1 '*/*'; then
|
||||||
packages=( $(_call_program packages $cmd[@] -Sql ${words[CURRENT]%/*}) )
|
packages=( $(_call_program packages $cmd[@] -Sql ${words[CURRENT]%/*}) )
|
||||||
typeset -U packages
|
typeset -U packages
|
||||||
|
if [[ -d /var/aur ]]; then
|
||||||
|
packages=( $packages $(ls /var/aur) )
|
||||||
|
fi
|
||||||
_wanted repo_packages expl "repository/package" compadd ${(@)packages}
|
_wanted repo_packages expl "repository/package" compadd ${(@)packages}
|
||||||
else
|
else
|
||||||
packages=( $(_call_program packages $cmd[@] -Sql) )
|
packages=( $(_call_program packages $cmd[@] -Sql) )
|
||||||
typeset -U packages
|
typeset -U packages
|
||||||
|
if [[ -d /var/aur ]]; then
|
||||||
|
packages=( $packages $(ls /var/aur) )
|
||||||
|
fi
|
||||||
_wanted packages expl "packages" compadd - "${(@)packages}"
|
_wanted packages expl "packages" compadd - "${(@)packages}"
|
||||||
|
|
||||||
repositories=(${(o)${${${(M)${(f)"$(</etc/pacman.conf)"}:#\[*}/\[/}/\]/}:#options})
|
repositories=(${(o)${${${(M)${(f)"$(</etc/pacman.conf)"}:#\[*}/\[/}/\]/}:#options})
|
||||||
|
|
Loading…
Reference in New Issue