_termhelper(){ 
    COMPREPLY=()
    _get_comp_words_by_ref cur prev words cword
    a=$(($cword +1))
    if [[ $cword -eq 1 ]] ; then
		LIST=$(ls -1 $DIR | awk -F. '{print $'"$a"'}' |sort |uniq)
    else
    n=1
	filter=$(for w in ${words[@]:1} ; do
		echo -n ${w}.
	done)
	LIST=$(ls -1 $DIR  | grep "$filter" | awk -F. '{print $'"$a"'}'|sort -u)
    fi
		COMPREPLY=( $(compgen -W "$LIST" -- ${cur}) )
}
prefix=$(echo $LANGUAGE |cut -f1 -d . |cut -f1 -d _)
[ ${#prefix} -ne 2 ] && prefix=$(echo $LANG |cut -f1 -d . |cut -f1 -d _)
[ ${#prefix} -ne 2 ] && prefix=$(echo $LC_MESSAGES |cut -f1 -d . |cut -f1 -d _)
DIR=/usr/share/termhelper/$prefix
complete -F _termhelper termhelper th справка aiuto
