wtf: Look for acronym db from /usr/share/games/bsdgames/acronyms too.

Submitted-by: Raphaël Droz (modified)
http://lists.alioth.debian.org/pipermail/bash-completion-devel/2013-November/004991.html
This commit is contained in:
Ville Skyttä 2013-11-26 19:45:02 +02:00
parent e694978346
commit 920bbb8582

View File

@ -22,9 +22,17 @@ _wtf()
fi
shift
done
[[ -z $db ]] && db=${ACRONYMDB:-/usr/share/misc/acronyms*}
COMPREPLY=( $( compgen -W "$( cut -f 1 -s $db 2>/dev/null ) $addf" \
if [[ -z "$db" ]]; then
local f
for f in "$ACRONYMDB" /usr/share/misc/acronyms \
/usr/share/games/bsdgames/acronyms; do
[[ -f "$f" ]] && db="$f" && break
done
[[ -z "$db" ]] && return 0
fi
COMPREPLY=( $( compgen -W "$( cut -f 1 -s $db* 2>/dev/null ) $addf" \
-- "${cur^^}" ) )
} &&
complete -F _wtf wtf