cheat/scripts/cheat-autocompletion.bash

10 lines
224 B
Bash
Raw Permalink Normal View History

function _cheat_autocomplete {
sheets=$(cheat -l | sed -n '2,$p'|cut -d' ' -f1)
2019-10-21 12:07:26 +02:00
COMPREPLY=()
if [ $COMP_CWORD = 1 ]; then
COMPREPLY=(`compgen -W "$sheets" -- $2`)
fi
}
complete -F _cheat_autocomplete cheat