1
1
mirror of https://github.com/chubin/cheat.sh.git synced 2024-12-04 11:51:35 +03:00
cheat.sh/share/zsh.txt

23 lines
518 B
Plaintext
Raw Normal View History

2018-07-13 17:51:25 +03:00
#compdef cht.sh
__CHTSH_LANGS=($(curl -s cheat.sh/:list))
_arguments -C \
'--help[show this help message and exit]: :->noargs' \
'--shell[enter shell repl]: :->noargs' \
'1:Cheat Sheet:->lang' \
'*::: :->noargs' && return 0
if [[ CURRENT -ge 1 ]]; then
case $state in
noargs)
_message "nothing to complete";;
lang)
compadd -X "Cheat Sheets" ${__CHTSH_LANGS[@]};;
*)
_message "Unknown state, error in autocomplete";;
esac
return
fi
2017-11-29 00:47:08 +03:00