27 lines
513 B
Bash
27 lines
513 B
Bash
# wtf completion
|
|
# Raphael Droz, 25/09/2009
|
|
|
|
have wtf &&
|
|
_wtf()
|
|
{
|
|
local cur prev db
|
|
|
|
COMPREPLY=()
|
|
cur=`_get_cword`
|
|
prev=${COMP_WORDS[COMP_CWORD-1]}
|
|
|
|
[ "$prev" = -f ] && _filedir && return 0
|
|
|
|
db=${ACRONYMDB:-/usr/share/misc/acronyms*}
|
|
COMPREPLY=( $( compgen -W "$( cut -f 1 -s $db )" -- "${cur^^}" ) )
|
|
} &&
|
|
complete -F _wtf $filenames wtf
|
|
|
|
# Local variables:
|
|
# mode: shell-script
|
|
# sh-basic-offset: 4
|
|
# sh-indent-comment: t
|
|
# indent-tabs-mode: nil
|
|
# End:
|
|
# ex: ts=4 sw=4 et filetype=sh
|