mirror of
https://github.com/cheat/cheat.git
synced 2024-11-21 21:41:35 +01:00
adding the autocompletion back
This commit is contained in:
parent
201cd1d629
commit
33e33dc7b7
@ -1,6 +1,9 @@
|
||||
function _cheat_autocomplete {
|
||||
wdlist='cheat -l|awk "{print $1}"'
|
||||
COMPREPLY=(`compgen -W "$wdlist"`)
|
||||
sheets=$(cheat -l | 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