summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--contrib/zsh_completion.in25
1 files changed, 25 insertions, 0 deletions
diff --git a/contrib/zsh_completion.in b/contrib/zsh_completion.in
index 84ee93ca..79ea8aa5 100644
--- a/contrib/zsh_completion.in
+++ b/contrib/zsh_completion.in
@@ -6,9 +6,11 @@ typeset -A opt_args
# options for passing to _arguments: main pacman commands
_pacman_opts_commands=(
+ '-D[Modify database]'
'-Q[Query the package database]'
'-R[Remove a package from the system]'
'-S[Synchronize packages]'
+ '-T[Check if dependencies are installed]'
'-U[Upgrade a package]'
'-V[Display version and exit]'
'-h[Display usage]'
@@ -71,6 +73,12 @@ _pacman_opts_remove=(
'*: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
_pacman_opts_sync_actions=(
'*-c[Remove old packages from cache]:*:clean:->sync_clean'
@@ -164,6 +172,16 @@ _pacman_action_remove() {
"$_pacman_opts_remove[@]"
}
+# handles --database subcommand
+_pacman_action_database() {
+ _arguments -s : \
+ '-D' \
+ "$_pacman_opts_common[@]" \
+ "$_pacman_opts_database[@]"
+}
+
+
+
# handles --sync subcommand
_pacman_action_sync() {
local context state line
@@ -288,6 +306,7 @@ _pacman_get_command() {
# main dispatcher
_pacman_zsh_comp() {
case $words[2] in
+ -D*) _pacman_action_database ;;
-Q*g*) # ipkg groups
_arguments -s : \
"$_pacman_opts_common[@]" \
@@ -324,6 +343,12 @@ _pacman_zsh_comp() {
'*:package group:_pacman_completions_all_groups'
;;
-S*) _pacman_action_sync ;;
+ -T*)
+ _arguments -s : \
+ '-T' \
+ "$_pacman_opts_common[@]" \
+ ":packages:_pacman_all_packages"
+ ;;
-U*) _pacman_action_upgrade ;;
-V*) _pacman_action_version ;;
-h*) _pacman_action_help ;;