PageRenderTime 31ms CodeModel.GetById 27ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/bash_completion_lib/complete/ipsec

http://github.com/brinkman83/bashrc
#! | 47 lines | 37 code | 10 blank | 0 comment | 0 complexity | ad578af0f3223d5f514a28f497fd8804 MD5 | raw file
 1# Linux ipsec(8) completion (for FreeS/WAN)
 2
 3
 4comp_include _get_cword
 5
 6
 7_ipsec()
 8{
 9    local cur
10
11    COMPREPLY=()
12    cur=`_get_cword`
13
14    
15    if [ $COMP_CWORD -eq 1 ]; then
16        COMPREPLY=( $( compgen -W 'auto barf eroute klipsdebug look \
17                       manual pluto ranbits rsasigkey \
18                       setup showdefaults showhostkey spi \
19                       spigrp tncfg whack' -- $cur ) )
20        return 0
21    fi
22
23    case ${COMP_WORDS[1]} in
24    auto)
25        COMPREPLY=( $( compgen -W '--asynchronous --up --add --delete \
26                       --replace --down --route --unroute \
27                       --ready --status --rereadsecrets' \
28                    -- $cur ) )
29        ;;
30    manual)
31        COMPREPLY=( $( compgen -W '--up --down --route --unroute \
32                       --union' -- $cur ) )
33        ;;
34    ranbits)
35        COMPREPLY=( $( compgen -W '--quick --continuous --bytes' \
36                      -- $cur ) )
37        ;;
38    setup)
39        COMPREPLY=( $( compgen -W '--start --stop --restart' -- $cur ) )
40        ;;
41
42    *)
43        ;;
44    esac
45
46    return 0
47} # _ipsec()