From 46b63ef30542d7356c63f22de27d5b7318355137 Mon Sep 17 00:00:00 2001 From: Igor Chubin Date: Mon, 29 May 2017 00:16:30 +0200 Subject: [PATCH] added share/bash.txt --- share/bash.txt | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 share/bash.txt diff --git a/share/bash.txt b/share/bash.txt new file mode 100644 index 0000000..9f19e11 --- /dev/null +++ b/share/bash.txt @@ -0,0 +1,23 @@ +cht() +{ + curl -s cheat.sh/"$1"?style=native +} + +_cheatsh_complete_cht() +{ + local cur opts #prev + _get_comp_words_by_ref -n : cur + + COMPREPLY=() + prev="${COMP_WORDS[COMP_CWORD-1]}" + opts="$(curl -s cheat.sh/:list)" + + #if [[ "${cur}" == cht ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + __ltrim_colon_completions "$cur" + return 0 + #fi +} + +complete -F _cheatsh_complete_cht cht +