#compdef xbuildbarf xbulk xbump xcheckrestart xdbg xdiff xdowngrade xgensum xgrep xi xilog xlg xlocate xlog xls xmindep xmypkgs xoptdiff xpkg xq xrecent xrevbump xrevshlib xsrc xsubpkg _xbps # force autoload _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' } _xtools_just_packages() { _arguments : \ '*:package:_xbps_all_packages' } _xtools_contributors() { compadd "$@" -- $(git -C "$(xdistdir)" log --pretty=%ce) } _xbulk() { _arguments : \ '-n[dry-run]' \ '-k[keep going when a build fails]' \ '*:available templates:_xtools_all_packages' } _xcheckrestart() { _arguments : \ '-v[verbose]' } _xdiff() { _arguments : \ '-u[only display differences]' \ '-l[only list files with differences]' \ ':directory:_files -/' } _xdowngrade() { _arguments : \ '*:package files:_files -g \*.xbps' } _xgensum() { _arguments : \ '-f[force downloading of files]' \ '-c[use content checksum]' \ '-i[substitute in-place]' \ ':available templates:_path_files -g "*(/)|template(N)"' } _xgrep() { _arguments : \ '1:pattern: ' \ '*:package:_xbps_installed_packages' } _xilog() { _arguments : \ '1::pattern: ' } _xlocate() { _arguments : \ '-S[sync with official xlocate.git]' \ '-g[update xlocate.git]' \ '1::pattern: ' } _xmypkgs() { _arguments : \ '1::contributor:_xtools_contributors' } _xoptdiff() { _arguments : \ '-q[only list differing packages]' \ '*:package:_xbps_installed_packages' } _xpkg() { _arguments : \ '-R[consider only packages from repository]:repository:_files -/' \ '-a[list all packages]' \ '-m[list manual packages]' \ '-O[list orphaned packages]' \ '-H[list packages on hold]' \ '-v[show version numbers]' \ '-V[show version numbers and description]' } _xq() { _arguments : \ '-R[include remote information too]' \ '*:package:_xbps_all_packages' } _xrevbump() { _arguments : \ '1:message: ' \ ':available templates:_xtools_all_packages' } _xsubpkg() { _arguments : \ '-m[list master package]'\ '*:package:_xbps_all_packages' } _xtools() { case "$service" in xbuildbarf) _xtools_one_arch "@";; xbulk) _xbulk "$@";; xbump) _xtools_one_template "$@";; xcheckrestart) _xcheckrestart "$@";; xdbg) _xtools_just_packages "$@";; xdiff) _xdiff "$@";; xdowngrade) _xdowngrade "$@";; xgensum) _xgensum "$@";; xgrep) _xgrep "$@";; xi) _xbps_install "$@";; xilog) _xilog"$@";; xlg) _xtools_one_template "$@";; xlocate) _xlocate "$@";; xlog) _xtools_one_template "$@";; xls) _xtools_just_packages "$@";; xmindep) _xtools_just_packages "$@";; xmypkgs) _xmypkgs "$@";; xoptdiff) _xoptdiff "$@";; xpkg) _xpkg "$@";; xq) _xq "$@";; xrecent) _xtools_one_arch "$@";; xrevbump) _xrevbump "$@";; xrevshlib) _xtools_one_template "$@";; xsrc) _xtools_one_template "$@";; xsubpkg) _xsubpkg "$@";; esac } _xtools "$@"