From 145c8eb52d7c782748bdc1e6a087c932243903bc Mon Sep 17 00:00:00 2001 From: Nathan Jones Date: Wed, 5 Dec 2007 10:45:23 -0500 Subject: Update zsh completion. Update zsh completion file to version 0.5-2 from AUR and add the new options in pacman 3.1. Signed-off-by: Nathan Jones Signed-off-by: Dan McGee --- contrib/zsh_completion | 85 +++++++++++++++++++++++++++++++++++++------------- 1 file changed, 64 insertions(+), 21 deletions(-) (limited to 'contrib') diff --git a/contrib/zsh_completion b/contrib/zsh_completion index 07cd422e..f6cd9008 100644 --- a/contrib/zsh_completion +++ b/contrib/zsh_completion @@ -1,6 +1,6 @@ -# file: /usr/share/zsh/site-functions/_pacman -# use the following in your zsh config: -# compdef pacman pacman.static=pacman +#compdef pacman pacman.static=pacman + +# copy this file to /usr/share/zsh/site-functions/_pacman typeset -A opt_args @@ -21,11 +21,15 @@ _pacman_opts_common=( '-h[Display syntax for the given operation]' '-r[Set alternate installation root]:installation root:_files -/' '-v[Be more verbose]' + '--cachedir[Alternate package cache location]:cache_location:_files -/' '--config[An alternate configuration file]:config file:_files' + '--logfile[An alternate log file]:config file:_files' '--noconfirm[Do not ask for confirmation]' + '--noprogressbar[Do not show a progress bar when downloading files]' + '--noscriptlet[Do not execute the install scriptlet if one exists]' ) -# options for passing to _arguments: options for --add, and --update commands +# options for passing to _arguments: options for --add and --update commands _pacman_opts_pkgfile=( '-d[Skip dependency checks]' '-f[Overwrite conflicting files]' @@ -43,8 +47,16 @@ _pacman_opts_query_actions=( # options for passing to _arguments: options for --query and subcommands _pacman_opts_query_modifiers=( + '-c[List package changelog]' + '-d[List packages installed as dependencies]' + '-e[List packages explicitly installed]' + '-g[List all members of a package group]' '-i[View package information]' + '-ii[View package information including backup files]' '-l[List package contents]' + '-m[List installed packages not found in sync db(s)]' + '-t[List packages not required by any package]' + '-u[List packages that can be upgraded]' ) # options for passing to _arguments: options for --remove command @@ -60,6 +72,7 @@ _pacman_opts_remove=( # options for passing to _arguments: options for --sync command _pacman_opts_sync_actions=( '*-c[Remove old packages from cache]:*:clean:->sync_clean' + '*-cc[Remove all packages from cache]:*:clean:->sync_clean' '-g[View all members of a package group]:*:package groups:->sync_group' '-s[Search package names and descriptions]:*:search text:->sync_search' ) @@ -67,6 +80,7 @@ _pacman_opts_sync_actions=( # options for passing to _arguments: options for --sync command _pacman_opts_sync_modifiers=( '-d[Skip dependency checks]' + '-e[Install dependencies only]' '-f[Overwrite conflicting files]' '-i[View package information]' '-l[List all packages in a repository]' @@ -76,6 +90,7 @@ _pacman_opts_sync_modifiers=( '-y[Download fresh package databases]' '*--ignore[Ignore a package upgrade]:package:_pacman_completions_installed_packages' '*--ignoregroup[Ignore a group upgrade]:package group:_pacman_completions_all_groups' + '--asdeps[Install packages as non-explicitly installed]' ) # handles --action subcommand @@ -209,43 +224,57 @@ _pacman_action_version() { _pacman_completions_all_groups() { local -a cmd groups _pacman_get_command - groups=( $(_call_program groups $cmd[@] -Sg | grep -e \^$PREFIX) ) + groups=( $(_call_program groups $cmd[@] -Sg) ) compadd "$@" -a groups } # provides completions for packages available from repositories +# these can be specified as either 'package' or 'repository/package' _pacman_completions_all_packages() { - local -a cmd packages repositories + local -a cmd packages repositories packages_long - repositories=( $(_call_program repositories cat /etc/pacman.conf | grep "^\[" | sed "s,\(\[\|\]\),,g" | grep -v "^options" | sort -u) ) - # these can be specified as either 'package' or 'repository/package' - if [[ "$PREFIX" == "" ]] ; then - packages=( $(_call_program packages ls /var/lib/pacman/sync/${^repositories} | grep -v "^/" | sed "s,\-[^-]*\-[^-]*$,," | sort -u) ) + repositories=(${(o)${${${(M)${(f)"$(