diff options
author | Daniel Wallace <danielwallace@gtmanfred.com> | 2013-03-06 15:41:12 -0500 |
---|---|---|
committer | Allan McRae <allan@archlinux.org> | 2013-03-10 09:07:00 +1000 |
commit | e43c2716504ca0ac8f8f5deedbeb2c3215326558 (patch) | |
tree | cef5898fb4f28bec35cf63075c8b1c42a63fa909 /contrib | |
parent | c9b7f9b0d0a85a8106d144edfdf3d22a7f7f9802 (diff) |
zsh completion: add deptest and database
Signed-off-by: Daniel Wallace <danielwallace@gtmanfred.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/zsh_completion.in | 25 |
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 ;; |