Open mnott opened 3 years ago
Each time I'm doing a TAB, I see things like this:
-bash: _get_comp_words_by_ref: command not found
I can avoid it by catching the errors:
$ cat ~/.bash.d/cht.sh _cht_complete() { local cur prev opts _get_comp_words_by_ref -n : cur 2>/dev/null COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" opts="$(curl -s cheat.sh/:list)" if [ ${COMP_CWORD} = 1 ]; then COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) __ltrim_colon_completions "$cur" 2>/dev/null fi return 0 } complete -F _cht_complete cht.sh
Notice the 2>/dev/null for both commands.
2>/dev/null
Do you have bash-completion installed? If not, you can try brew install bash_completion
Each time I'm doing a TAB, I see things like this:
I can avoid it by catching the errors:
Notice the
2>/dev/null
for both commands.