From 39f835989f79e4c042ee954f803142d0c8ba3bf0 Mon Sep 17 00:00:00 2001 From: Johannes Brechtmann Date: Sat, 10 Nov 2018 02:24:02 +0100 Subject: xbuildbarf: add zsh completion Closes: #104 [via git-merge-pr] --- _xtools | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to '_xtools') diff --git a/_xtools b/_xtools index 17c1f7a..88d4c8e 100644 --- a/_xtools +++ b/_xtools @@ -1,4 +1,4 @@ -#compdef xbulk xbump xcheckrestart xdiff xdbg xdowngrade xgensum xgrep xlg xlog xlocate xls xmindep xmypkgs xnew xoptdiff xpkg xq xrecent xrevbump xrevshlib xsrc +#compdef xbuildbarf xbulk xbump xcheckrestart xdiff xdbg xdowngrade xgensum xgrep xlg xlog xlocate xls xmindep xmypkgs xnew xoptdiff xpkg xq xrecent xrevbump xrevshlib xsrc _xbps # force autoload @@ -6,6 +6,12 @@ _xtools_all_packages() { compadd "$@" -- $(xdistdir)/srcpkgs/*(:t) } +_xtools_one_arch() { + local archs=( {aarch64,armv{6,7}l,i686,x86_64}{,-musl} ) + _arguments : \ + ":architecture:($archs)" +} + _xtools_one_template() { _arguments : \ ':available templates:_xtools_all_packages' @@ -99,12 +105,6 @@ _xq() { '*:package:_xbps_all_packages' } -_xrecent() { - local archs=( {aarch64,armv{6,7}l,i686,x86_64}{,-musl} ) - _arguments : \ - "1::architecture:($archs)" -} - _xrevbump() { _arguments : \ '1:message: ' \ @@ -119,6 +119,7 @@ _xsubpkg() { _xtools() { case "$service" in + xbuildbarf) _xtools_one_arch "@";; xbulk) _xbulk "$@";; xbump) _xtools_one_template "$@";; xcheckrestart) _xcheckrestart "$@";; @@ -138,7 +139,7 @@ _xtools() { xoptdiff) _xoptdiff "$@";; xpkg) _xpkg "$@";; xq) _xq "$@";; - xrecent) _xrecent "$@";; + xrecent) _xtools_one_arch "$@";; xrevbump) _xrevbump "$@";; xrevshlib) _xtools_one_template "$@";; xsrc) _xtools_one_template "$@";; -- cgit 1.4.1