#compdef sbohints

# 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]:' \
	   '(-)'{-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 \
	   '--reset[Remove all hints.]:' \
	   '(-q --query)'{-q,--query}'[Get the hint status of one or more scripts.]:' \
	   '(-l --list)'{-l,--list}'[Display all hints.]:' \
	   '(-b --blacklist)'{-b,--blacklist}'[Add (or clear with -c) scripts to the blacklist.]:' \
	   '(-o --optional)'{-o,--optional}'[Add (or clear with -c) optional dependency requests for one or more scripts.]:' \
	   '(-r --reverse)'{-r,--reverse}'[Add (or clear with -c) reverse dependency rebuild requests for one or more scripts.]:' \
	   '(-O --replace-optional)'{-O,--replace-optional}'[Replace (or remove with -r) all optional dependency requests for one or more scripts.]:' \
	   '(-c --clear)'{-c,--clear}'[Together with -b, -r, -o or -O, clear items instead of adding or replacing.]:'\
	   '(-)*:SlackBuild:(${slackbuilds:|words})' \
    && return 0

return 1

# Local Variables:
# mode: sh
# End:
