- dict completion by Alex Shinn <foof@synthcode.com>
This commit is contained in:
parent
3925cc557d
commit
f421c5ea8f
30
contrib/dict
Normal file
30
contrib/dict
Normal file
@ -0,0 +1,30 @@
|
||||
# dict completion by Alex Shinn <foof@synthcode.com>
|
||||
|
||||
_dict()
|
||||
{
|
||||
local cur DICTFILE
|
||||
|
||||
COMPREPLY=()
|
||||
cur=${COMP_WORDS[COMP_CWORD]}
|
||||
DICTFILE=/usr/share/dict/words
|
||||
|
||||
case "$cur" in
|
||||
--*)
|
||||
COMPREPLY=( $( compgen -W '--help --version --verbose \
|
||||
--host --port --database --match --strategy \
|
||||
--config --nocorrect --dbs --starts --serverhelp \
|
||||
--info --serverinfo --noauth --user --key --license \
|
||||
--raw --pager --debug --pipesize --client' -- $cur ) )
|
||||
;;
|
||||
-*)
|
||||
COMPREPLY=( $( compgen -W '-h -p -d -m -s -c -C -D -S \
|
||||
-H -i -I -a -u -k -V -L -v -r -P' $cur ) )
|
||||
;;
|
||||
*)
|
||||
COMPREPLY=( $( compgen -W '$( cat $DICTFILE )' -- $cur ) )
|
||||
;;
|
||||
esac
|
||||
|
||||
return 0
|
||||
}
|
||||
complete -F _dict dict
|
Loading…
x
Reference in New Issue
Block a user