#autoload +X _bk_helptopics() { local -U topics local helpfile # This probably isn't the best way of checking to see if we need to # look at an alternate helpfile. if [[ ${#${(M)words:#-f*}} -ne 0 ]]; then print "Here" >> /tmp/blah helpfile=${${(M)words:#-f*}[-1]#-f} else helpfile=$(bk bin)/bkhelp.txt fi topics=( ${${${${${(f)"$(grep '^help://' $helpfile)"}#help://}%.(1|sum)}:#bk-*}:#*[/ ]*} ) compadd -a topics }