#compdef sbofind

# sbotools: https://pghvlaans.github.io/sbotools/

# grab a listing of all available slackbuilds
slackbuilds=( ${(uf)"$(perl -MSBO::Lib::Tree=get_all_available -E 'say $_ for get_all_available();')"} )

_arguments -s \
	   - info \
	   '(-)'{-h,--help}'[Show help information.]:' \
	   '(-)'{-v,--version}'[Show version information.]:' \
	   - formatting \
	   '--nocolor[Disable sbotools color output.]:' \
	   '--color[Enable sbotools color output.]:' \
	   '--nowrap[Disable sbotools word wrapping.]:' \
	   '--wrap[Enable sbotools word wrapping.]:' \
	   - commands \
	   '(-A --all-reverse)'{-A,--all-reverse}'[Show all reverse dependencies in the repo.]' \
	   '(-E --exact-case)'{-E,--exact-case}'[Only exact matching (case-sensitive).]' \
	   '(-e --exact)'{-e,--exact}'[Only exact matching (case-insensitive).]' \
	   '(-F --first-reverse)'{-F,--first-reverse}'[Show the first level of reverse dependencies.]' \
	   '(-t --no-tags)'{-t,--no-tags}'[Exclude tags from search.]' \
	   '(-i --info)'{-i,--info}'[Show the contents of the .info file for each SlackBuild.]' \
	   '(-R --reverse)'{-R,--reverse}'[Show any reverse dependencies installed on the system.]' \
	   '(-r --readme)'{-r,--readme}'[Show the contents of the README file for each SlackBuild found.]' \
	   '(-q --queue)'{-q,--queue}'[Show the build queue for each SlackBuild found.]' \
	   '(-T --top-reverse)'{-T,--top-reverse}'[Show the last level of reverse dependencies.]' \
	   '--raw[Print a list of matching names only.]' \
	   '(-)*:SBo SlackBuild:(${slackbuilds:|words})' \
    && return 0

return 1

# Local Variables:
# mode: sh
# End:
