diff options
Diffstat (limited to 'completions/ipsec')
-rw-r--r-- | completions/ipsec | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/completions/ipsec b/completions/ipsec index 00e6b7ea..4bc8cdf3 100644 --- a/completions/ipsec +++ b/completions/ipsec @@ -8,9 +8,9 @@ _ipsec_connections() local keyword name while read -r keyword name; do if [[ $keyword == [#]* ]]; then continue; fi - [[ $keyword == conn && $name != '%default' ]] && COMPREPLY+=( "$name" ) + [[ $keyword == conn && $name != '%default' ]] && COMPREPLY+=("$name") done - COMPREPLY=( $(compgen -W '${COMPREPLY[@]}' -- "$cur") ) + COMPREPLY=($(compgen -W '${COMPREPLY[@]}' -- "$cur")) } _ipsec_freeswan() @@ -18,31 +18,31 @@ _ipsec_freeswan() local cur prev words cword _init_completion || return - if [[ $cword -eq 1 ]]; then - COMPREPLY=( $(compgen -W 'auto barf eroute klipsdebug look manual + if ((cword == 1)); then + COMPREPLY=($(compgen -W 'auto barf eroute klipsdebug look manual pluto ranbits rsasigkey setup showdefaults showhostkey spi spigrp - tncfg whack' -- "$cur") ) + tncfg whack' -- "$cur")) return fi case ${words[1]} in auto) - COMPREPLY=( $(compgen -W '--asynchronous --up --add --delete + COMPREPLY=($(compgen -W '--asynchronous --up --add --delete --replace --down --route --unroute --ready --status - --rereadsecrets' -- "$cur") ) + --rereadsecrets' -- "$cur")) ;; manual) - COMPREPLY=( $(compgen -W '--up --down --route --unroute --union' \ - -- "$cur") ) + COMPREPLY=($(compgen -W '--up --down --route --unroute --union' \ + -- "$cur")) ;; ranbits) - COMPREPLY=( $(compgen -W '--quick --continuous --bytes' -- "$cur") ) + COMPREPLY=($(compgen -W '--quick --continuous --bytes' -- "$cur")) ;; setup) - COMPREPLY=( $(compgen -W '--start --stop --restart' -- "$cur") ) - ;; - *) + COMPREPLY=($(compgen -W '--start --stop --restart' -- "$cur")) ;; + *) ;; + esac } @@ -51,8 +51,8 @@ _ipsec_strongswan() local cur prev words cword _init_completion || return - if [[ $cword -eq 1 ]]; then - COMPREPLY=( $(compgen -W 'down irdumm leases listaacerts listacerts + if ((cword == 1)); then + COMPREPLY=($(compgen -W 'down irdumm leases listaacerts listacerts listalgs listall listcacerts listcainfos listcards listcerts listcrls listgroups listocsp listocspcerts listpubkeys openac pki pluto pool purgecerts purgecrls purgeike purgeocsp ready reload @@ -60,33 +60,33 @@ _ipsec_strongswan() rereadgroups rereadocspcerts rereadsecrets restart route scdecrypt scencrypt scepclient secrets start starter status statusall stop stroke unroute uci up update version whack --confdir --copyright - --directory --help --version --versioncode' -- "$cur") ) + --directory --help --version --versioncode' -- "$cur")) return fi case ${words[1]} in - down|route|status|statusall|unroute|up) + down | route | status | statusall | unroute | up) local confdir=$(ipsec --confdir) _ipsec_connections <"$confdir/ipsec.conf" ;; list*) - COMPREPLY=( $(compgen -W '--utc' -- "$cur") ) + COMPREPLY=($(compgen -W '--utc' -- "$cur")) ;; - restart|start) - COMPREPLY=( $(compgen -W '--attach-gdb --auto-update --debug - --debug-all --debug-more --nofork' -- "$cur") ) + restart | start) + COMPREPLY=($(compgen -W '--attach-gdb --auto-update --debug + --debug-all --debug-more --nofork' -- "$cur")) ;; pki) - COMPREPLY=( $(compgen -W '--gen --issue --keyid --print --pub - --req --self --signcrl --verify' -- "$cur") ) - ;; - pool) + COMPREPLY=($(compgen -W '--gen --issue --keyid --print --pub + --req --self --signcrl --verify' -- "$cur")) ;; + pool) ;; + irdumm) _filedir 'rb' ;; - *) - ;; + *) ;; + esac } |