From e43c2716504ca0ac8f8f5deedbeb2c3215326558 Mon Sep 17 00:00:00 2001 From: Daniel Wallace Date: Wed, 6 Mar 2013 15:41:12 -0500 Subject: zsh completion: add deptest and database Signed-off-by: Daniel Wallace Signed-off-by: Allan McRae --- contrib/zsh_completion.in | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'contrib') 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 ;; -- cgit v1.2.3-70-g09d2