| 1 | ### -*-sh-*- |
| 2 | |
| 3 | [ "$(type -t _command)" = "function" ] && |
| 4 | complete -F _command r rootly |
| 5 | |
| 6 | declare -a _hyperspec_completions |
| 7 | _hyperspec_made_completions=no |
| 8 | _complete-hyperspec () { |
| 9 | case "$_hyperspec_made_completions" in |
| 10 | no) |
| 11 | _hyperspec_completions=($(hyperspec -l)) |
| 12 | _hyperspec_made_completions=yes |
| 13 | ;; |
| 14 | esac |
| 15 | COMPREPLY=() |
| 16 | local -i i=0 |
| 17 | local prefix=${COMP_WORDS[$COMP_CWORD]} |
| 18 | for sym in "${_hyperspec_completions[@]}"; do |
| 19 | case "$sym" in |
| 20 | $prefix*) |
| 21 | COMPREPLY[$i]=$sym |
| 22 | i+=1 |
| 23 | ;; |
| 24 | esac |
| 25 | done |
| 26 | } |
| 27 | complete -F _complete-hyperspec hyperspec |