PageRenderTime 80ms CodeModel.GetById 77ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/bash_completion_lib/complete/postfix

http://github.com/brinkman83/bashrc
#! | 28 lines | 24 code | 4 blank | 0 comment | 0 complexity | f0e4d1c7c120091957b19bb8cb13a91c MD5 | raw file
 1# Postfix completion.
 2#
 3comp_include _filedir _get_cword
 4
 5
 6_postfix()
 7{
 8    local cur prev
 9
10    cur=`_get_cword`
11    prev=${COMP_WORDS[COMP_CWORD-1]}
12
13    if [[ $cur == '-' ]]; then
14        COMPREPLY=(-c -D -v)
15        return 0
16    fi
17    if [[ $prev == '-c' ]]; then
18        _filedir -d
19        return 0
20    fi
21    if [[ $prev == '-D' ]]; then
22        COMPREPLY=( $( compgen -W 'start' -- "${COMP_WORDS[COMP_CWORD]}" ) )
23        return 0
24    fi
25    COMPREPLY=( $( compgen -W 'start stop reload abort flush check' -- \
26        "${COMP_WORDS[COMP_CWORD]}" ) )
27}
28_postfix