zsh completion: add deptest and database
Signed-off-by: Daniel Wallace <danielwallace@gtmanfred.com> Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
parent
c9b7f9b0d0
commit
e43c271650
1 changed files with 25 additions and 0 deletions
|
@ -6,9 +6,11 @@ typeset -A opt_args
|
||||||
|
|
||||||
# options for passing to _arguments: main pacman commands
|
# options for passing to _arguments: main pacman commands
|
||||||
_pacman_opts_commands=(
|
_pacman_opts_commands=(
|
||||||
|
'-D[Modify database]'
|
||||||
'-Q[Query the package database]'
|
'-Q[Query the package database]'
|
||||||
'-R[Remove a package from the system]'
|
'-R[Remove a package from the system]'
|
||||||
'-S[Synchronize packages]'
|
'-S[Synchronize packages]'
|
||||||
|
'-T[Check if dependencies are installed]'
|
||||||
'-U[Upgrade a package]'
|
'-U[Upgrade a package]'
|
||||||
'-V[Display version and exit]'
|
'-V[Display version and exit]'
|
||||||
'-h[Display usage]'
|
'-h[Display usage]'
|
||||||
|
@ -71,6 +73,12 @@ _pacman_opts_remove=(
|
||||||
'*:installed package:_pacman_completions_installed_packages'
|
'*:installed package:_pacman_completions_installed_packages'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
_pacman_opts_database=(
|
||||||
|
'--asdeps[mark packages as non-explicitly installed]'
|
||||||
|
'--asexplicit[mark packages as explicitly installed]'
|
||||||
|
'*:installed package:_pacman_completions_installed_packages'
|
||||||
|
)
|
||||||
|
|
||||||
# options for passing to _arguments: options for --sync command
|
# options for passing to _arguments: options for --sync command
|
||||||
_pacman_opts_sync_actions=(
|
_pacman_opts_sync_actions=(
|
||||||
'*-c[Remove old packages from cache]:*:clean:->sync_clean'
|
'*-c[Remove old packages from cache]:*:clean:->sync_clean'
|
||||||
|
@ -164,6 +172,16 @@ _pacman_action_remove() {
|
||||||
"$_pacman_opts_remove[@]"
|
"$_pacman_opts_remove[@]"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# handles --database subcommand
|
||||||
|
_pacman_action_database() {
|
||||||
|
_arguments -s : \
|
||||||
|
'-D' \
|
||||||
|
"$_pacman_opts_common[@]" \
|
||||||
|
"$_pacman_opts_database[@]"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# handles --sync subcommand
|
# handles --sync subcommand
|
||||||
_pacman_action_sync() {
|
_pacman_action_sync() {
|
||||||
local context state line
|
local context state line
|
||||||
|
@ -288,6 +306,7 @@ _pacman_get_command() {
|
||||||
# main dispatcher
|
# main dispatcher
|
||||||
_pacman_zsh_comp() {
|
_pacman_zsh_comp() {
|
||||||
case $words[2] in
|
case $words[2] in
|
||||||
|
-D*) _pacman_action_database ;;
|
||||||
-Q*g*) # ipkg groups
|
-Q*g*) # ipkg groups
|
||||||
_arguments -s : \
|
_arguments -s : \
|
||||||
"$_pacman_opts_common[@]" \
|
"$_pacman_opts_common[@]" \
|
||||||
|
@ -324,6 +343,12 @@ _pacman_zsh_comp() {
|
||||||
'*:package group:_pacman_completions_all_groups'
|
'*:package group:_pacman_completions_all_groups'
|
||||||
;;
|
;;
|
||||||
-S*) _pacman_action_sync ;;
|
-S*) _pacman_action_sync ;;
|
||||||
|
-T*)
|
||||||
|
_arguments -s : \
|
||||||
|
'-T' \
|
||||||
|
"$_pacman_opts_common[@]" \
|
||||||
|
":packages:_pacman_all_packages"
|
||||||
|
;;
|
||||||
-U*) _pacman_action_upgrade ;;
|
-U*) _pacman_action_upgrade ;;
|
||||||
-V*) _pacman_action_version ;;
|
-V*) _pacman_action_version ;;
|
||||||
-h*) _pacman_action_help ;;
|
-h*) _pacman_action_help ;;
|
||||||
|
|
Loading…
Add table
Reference in a new issue