From 69c3f3b7cec7950b07ed5f47c155c521d00a79e4 Mon Sep 17 00:00:00 2001 From: Steve Prybylski Date: Sat, 31 Oct 2015 21:00:08 -0400 Subject: [PATCH] _xbps: update zsh completion --- data/_xbps | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/data/_xbps b/data/_xbps index d077ec3d..601f437d 100644 --- a/data/_xbps +++ b/data/_xbps @@ -1,10 +1,9 @@ -#compdef xbps-checkvers xbps-create xbps-dgraph xbps-install xbps-pkgdb xbps-query xbps-reconfigure xbps-remove xbps-rindex xbps-uchroot xbps-uunshare xbps-uhelper +#compdef xbps-alternatives xbps-checkvers xbps-create xbps-dgraph xbps-install xbps-pkgdb xbps-query xbps-reconfigure xbps-remove xbps-rindex xbps-uchroot xbps-uunshare xbps-uhelper _xbps_common=( {-C,--config=-}'[Full path to configuration file]:config file:_files' {-d,--debug}'[Debug mode shown to stderr]' {-h,--help}'[Print help usage]' - {-n,--dry-run}'[Dry-run mode]' {-r,--rootdir=-}'[Full path to rootdir]:root dir:_files -/' {-v,--verbose}'[Verbose messages]' {-V,--version}'[Show XBPS version]' @@ -51,6 +50,19 @@ _xbps_installed_packages() { compadd "$@" -- ${${${(f)"$(xbps-query -l)"}#?? }%%-[^- ]# *} } +_xbps_alternatives_groups() { + compadd "$@" -- ${${${(f)"$(xbps-alternatives -l)"}##? }%%-# *} +} + +_xbps_alternatives() { + _arguments -s : \ + $_xbps_common \ + {-g,--group}'[Group of alternatives to match]:group:_xbps_alternatives_groups' \ + {-l,--list}'[List all alternatives]' \ + {-s,--set}'[Set alternatives]' \ + '*:installed packages:_xbps_installed_packages' +} + _xbps_checkvers() { _arguments -s : \ $_xbps_common \ @@ -111,6 +123,7 @@ _xbps_install() { {-c,--cachedir=-}'[Full path to cachedir]:cache dir:_files -/' \ {-f,--force}'[Force package re-installation]' \ {-i,--ignore-conf-repos}'[Ignore repositories defined in xbps.d]' \ + {-n,--dry-run}'[Dry-run mode]' \ {-M,--memory-sync}'[Keep remote repository data in memory only]' \ '*'{-R,--repository=-}'[Add repository to the top of the list]:repository url:_files -/' \ {-S,--sync}'[Sync remote repository index]' \ @@ -173,6 +186,7 @@ _xbps_remove() { {-f,--force}'[Force package files removal]' \ {-O,--clean-cache}'[Remove obsolete packages in cachedir]' \ {-o,--remove-orphans}'[Remove package orphans]' \ + {-n,--dry-run}'[Dry-run mode]' \ {-R,--recursive}'[Recursively remove dependencies]' \ {-y,--yes}'[Assume yes to all questions]' \ '*:installed packages:_xbps_installed_packages' @@ -246,6 +260,7 @@ _xbps_uhelper() { _xbps() { case "$service" in + xbps-alternatives) _xbps_alternatives "$@";; xbps-checkvers) _xbps_checkvers "$@";; xbps-create) _xbps_create "$@";; xbps-dgraph) _xbps_dgraph "$@";;