1
0
mirror of https://github.com/cheat/cheat.git synced 2025-05-29 03:17:05 +02:00

Merge pull request from zhujian0805/master

adding the cheat autocomplete script back :)
This commit is contained in:
Chris Allen Lane 2019-11-04 18:12:12 -05:00 committed by GitHub
commit 2c0099c28a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,9 @@
function _cheat_autocomplete {
sheets=$(cheat -l | sed -n '2,$p'|cut -d' ' -f1)
COMPREPLY=()
if [ $COMP_CWORD = 1 ]; then
COMPREPLY=(`compgen -W "$sheets" -- $2`)
fi
}
complete -F _cheat_autocomplete cheat