cheat/autocompletion/cheat.bash

10 lines
210 B
Bash
Raw Normal View History

2013-09-12 03:25:10 +02:00
function _cheat_autocomplete {
sheets=$(cheat -l | cut -d' ' -f1)
2013-09-12 03:25:10 +02:00
COMPREPLY=()
if [ $COMP_CWORD = 1 ]; then
COMPREPLY=(`compgen -W "$sheets" -- $2`)
fi
}
complete -F _cheat_autocomplete cheat