/bash_completion_lib/complete -o default/dropdb
http://github.com/brinkman83/bashrc · #! · 32 lines · 25 code · 7 blank · 0 comment · 0 complexity · a9319f15f7214c98ed49819928d572bf MD5 · raw file
- comp_include _get_cword _known_hosts _pg_databases _pg_users
- _dropdb()
- {
- local cur prev
- COMPREPLY=()
- cur=`_get_cword`
- prev=${COMP_WORDS[COMP_CWORD-1]}
- case "$prev" in
- -@(h|-host=))
- _known_hosts
- return 0
- ;;
- -@(U|-username=))
- _pg_users
- return 0
- ;;
- esac
- if [[ "$cur" == -* ]]; then
- COMPREPLY=( $( compgen -W '-h -p -U -W -e -q \
- --host= --port= --username= --password \
- --interactive --echo --quiet --help' -- $cur ) )
- else
- _pg_databases
- fi
- } # _dropdb()