_sbofind (1181B)
1 #compdef sbofind 2 3 # sbotools: https://pink-mist.github.io/sbotools/ 4 5 # work out where the SBo repo is (default to /usr/sbo/repo) 6 # but also check for SBO_HOME setting in /etc/sbotools/sbotools.conf 7 grep 'SBO_HOME' /etc/sbotools/sbotools.conf &> /dev/null 8 if [ $? -eq 0 ]; then 9 repo="$(grep 'SBO_HOME' /etc/sbotools/sbotools.conf | cut -d= -f2)/repo" 10 else 11 repo='/usr/sbo/repo' 12 fi 13 14 # grab a listing of all slackbuilds 15 slackbuilds=( ${(uf)"$(grep 'SLACKBUILD NAME: ' $repo/SLACKBUILDS.TXT | cut -b 18-)"} ) 16 17 _arguments -s \ 18 - info \ 19 '(-)'{-h,--help}'[Show help information.]:' \ 20 '(-)'{-v,--version}'[Show version information.]:' \ 21 - commands \ 22 '(-e --exact)'{-e,--exact}'[Only exact matching.]' \ 23 '(-t --no-tags)'{-t,--no-tags}'[Exclude tags from search.]' \ 24 '(-i --info)'{-i,--info}'[Show the contents of the .info file for each SlackBuild.]' \ 25 '(-r --readme)'{-r,--readme}'[Show the contents of the README file for each SlackBuild found.]' \ 26 '(-q --queue)'{-q,--queue}'[Show the build queue for each SlackBuild found.]' \ 27 '(-)*:SBo SlackBuild:(${slackbuilds:|words})' \ 28 && return 0 29 30 return 1 31 32 # Local Variables: 33 # mode: sh 34 # End: