PageRenderTime 67ms CodeModel.GetById 65ms app.highlight 0ms RepoModel.GetById 1ms app.codeStats 0ms

/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
 1comp_include _get_cword _known_hosts _pg_databases _pg_users
 2
 3
 4_dropdb()
 5{
 6    local cur prev
 7
 8    COMPREPLY=()
 9    cur=`_get_cword`
10    prev=${COMP_WORDS[COMP_CWORD-1]}
11
12    case "$prev" in
13    -@(h|-host=)) 
14        _known_hosts
15        return 0
16        ;;
17    -@(U|-username=))
18        _pg_users
19        return 0
20        ;;
21    esac
22
23    if [[ "$cur" == -* ]]; then
24        COMPREPLY=( $( compgen -W '-h -p -U -W -e -q \
25                --host= --port= --username= --password \
26                --interactive --echo --quiet --help' -- $cur ) )
27    else
28        _pg_databases
29    fi
30} # _dropdb()
31
32