mirror of
https://github.com/cheat/cheat.git
synced 2024-12-18 10:45:05 +01:00
Merge pull request #479 from zhujian0805/master
adding the cheat autocomplete script back :)
This commit is contained in:
commit
2c0099c28a
9
scripts/cheat-autocompletion.bash
Executable file
9
scripts/cheat-autocompletion.bash
Executable file
@ -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
|
Loading…
Reference in New Issue
Block a user