1
1
mirror of https://github.com/chubin/cheat.sh.git synced 2024-12-11 09:47:23 +03:00
cheat.sh/share/bash_completion.txt

19 lines
433 B
Bash
Raw Normal View History

2017-05-26 15:03:26 +03:00
_cheatsh_complete_curl()
2017-05-09 00:18:23 +03:00
{
local cur prev opts
_get_comp_words_by_ref -n : cur
COMPREPLY=()
#cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
opts="$(curl -s cheat.sh/:list | sed s@^@cheat.sh/@)"
if [[ ${cur} == cheat.sh/* ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
__ltrim_colon_completions "$cur"
return 0
2017-05-26 15:03:26 +03:00
fi
2017-05-09 00:18:23 +03:00
}
complete -F _cheatsh_complete_curl curl