Split ipsec completion into contrib/ipsec.
This commit is contained in:
parent
3f1f6120d7
commit
887361302b
1
CHANGES
1
CHANGES
@ -60,6 +60,7 @@ bash-completion (2.x)
|
|||||||
* Split chown, chgrp, and id completions into contrib/coreutils.
|
* Split chown, chgrp, and id completions into contrib/coreutils.
|
||||||
* Split kill, look, and renice completions into contrib/util-linux.
|
* Split kill, look, and renice completions into contrib/util-linux.
|
||||||
* Split killall, pkill, pgrep and related completions into contrib/procps.
|
* Split killall, pkill, pgrep and related completions into contrib/procps.
|
||||||
|
* Split ipsec completion into contrib/ipsec.
|
||||||
* Do basic HTML file completion with Firefox and Chrome and friends,
|
* Do basic HTML file completion with Firefox and Chrome and friends,
|
||||||
and Epiphany.
|
and Epiphany.
|
||||||
* Do basic diff/patch completion with cdiff and kompare.
|
* Do basic diff/patch completion with cdiff and kompare.
|
||||||
|
@ -59,6 +59,7 @@ bashcomp_DATA = contrib/abook \
|
|||||||
contrib/info \
|
contrib/info \
|
||||||
contrib/iptables \
|
contrib/iptables \
|
||||||
contrib/ipmitool \
|
contrib/ipmitool \
|
||||||
|
contrib/ipsec \
|
||||||
contrib/ipv6calc \
|
contrib/ipv6calc \
|
||||||
contrib/isql \
|
contrib/isql \
|
||||||
contrib/jar \
|
contrib/jar \
|
||||||
|
@ -1102,50 +1102,6 @@ _ifupdown()
|
|||||||
complete -F _ifupdown ifup ifdown
|
complete -F _ifupdown ifup ifdown
|
||||||
[ $USERLAND = GNU ] && have ifstatus && complete -F _ifupdown ifstatus
|
[ $USERLAND = GNU ] && have ifstatus && complete -F _ifupdown ifstatus
|
||||||
|
|
||||||
# Linux ipsec(8) completion (for FreeS/WAN)
|
|
||||||
#
|
|
||||||
[ $UNAME = Linux ] && have ipsec &&
|
|
||||||
_ipsec()
|
|
||||||
{
|
|
||||||
local cur
|
|
||||||
|
|
||||||
COMPREPLY=()
|
|
||||||
cur=`_get_cword`
|
|
||||||
|
|
||||||
|
|
||||||
if [ $COMP_CWORD -eq 1 ]; then
|
|
||||||
COMPREPLY=( $( compgen -W 'auto barf eroute klipsdebug look manual \
|
|
||||||
pluto ranbits rsasigkey setup showdefaults showhostkey spi spigrp \
|
|
||||||
tncfg whack' -- "$cur" ) )
|
|
||||||
return 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
case ${COMP_WORDS[1]} in
|
|
||||||
auto)
|
|
||||||
COMPREPLY=( $( compgen -W '--asynchronous --up --add --delete \
|
|
||||||
--replace --down --route --unroute \
|
|
||||||
--ready --status --rereadsecrets' \
|
|
||||||
-- "$cur" ) )
|
|
||||||
;;
|
|
||||||
manual)
|
|
||||||
COMPREPLY=( $( compgen -W '--up --down --route --unroute \
|
|
||||||
--union' -- "$cur" ) )
|
|
||||||
;;
|
|
||||||
ranbits)
|
|
||||||
COMPREPLY=( $( compgen -W '--quick --continuous --bytes' \
|
|
||||||
-- "$cur" ) )
|
|
||||||
;;
|
|
||||||
setup)
|
|
||||||
COMPREPLY=( $( compgen -W '--start --stop --restart' -- "$cur" ) )
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
return 0
|
|
||||||
} &&
|
|
||||||
complete -F _ipsec ipsec
|
|
||||||
|
|
||||||
# This function provides simple user@host completion
|
# This function provides simple user@host completion
|
||||||
#
|
#
|
||||||
_user_at_host() {
|
_user_at_host() {
|
||||||
|
51
contrib/ipsec
Normal file
51
contrib/ipsec
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
# Linux ipsec(8) completion (for FreeS/WAN)
|
||||||
|
#
|
||||||
|
[ $UNAME = Linux ] && have ipsec &&
|
||||||
|
_ipsec()
|
||||||
|
{
|
||||||
|
local cur
|
||||||
|
|
||||||
|
COMPREPLY=()
|
||||||
|
cur=`_get_cword`
|
||||||
|
|
||||||
|
|
||||||
|
if [ $COMP_CWORD -eq 1 ]; then
|
||||||
|
COMPREPLY=( $( compgen -W 'auto barf eroute klipsdebug look manual \
|
||||||
|
pluto ranbits rsasigkey setup showdefaults showhostkey spi spigrp \
|
||||||
|
tncfg whack' -- "$cur" ) )
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
case ${COMP_WORDS[1]} in
|
||||||
|
auto)
|
||||||
|
COMPREPLY=( $( compgen -W '--asynchronous --up --add --delete \
|
||||||
|
--replace --down --route --unroute \
|
||||||
|
--ready --status --rereadsecrets' \
|
||||||
|
-- "$cur" ) )
|
||||||
|
;;
|
||||||
|
manual)
|
||||||
|
COMPREPLY=( $( compgen -W '--up --down --route --unroute \
|
||||||
|
--union' -- "$cur" ) )
|
||||||
|
;;
|
||||||
|
ranbits)
|
||||||
|
COMPREPLY=( $( compgen -W '--quick --continuous --bytes' \
|
||||||
|
-- "$cur" ) )
|
||||||
|
;;
|
||||||
|
setup)
|
||||||
|
COMPREPLY=( $( compgen -W '--start --stop --restart' -- "$cur" ) )
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
return 0
|
||||||
|
} &&
|
||||||
|
complete -F _ipsec ipsec
|
||||||
|
|
||||||
|
# Local variables:
|
||||||
|
# mode: shell-script
|
||||||
|
# sh-basic-offset: 4
|
||||||
|
# sh-indent-comment: t
|
||||||
|
# indent-tabs-mode: nil
|
||||||
|
# End:
|
||||||
|
# ex: ts=4 sw=4 et filetype=sh
|
1
test/completion/ipsec.exp
Normal file
1
test/completion/ipsec.exp
Normal file
@ -0,0 +1 @@
|
|||||||
|
assert_source_completions ipsec
|
20
test/lib/completions/ipsec.exp
Normal file
20
test/lib/completions/ipsec.exp
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
proc setup {} {
|
||||||
|
save_env
|
||||||
|
}; # setup()
|
||||||
|
|
||||||
|
|
||||||
|
proc teardown {} {
|
||||||
|
assert_env_unmodified
|
||||||
|
}; # teardown()
|
||||||
|
|
||||||
|
|
||||||
|
setup
|
||||||
|
|
||||||
|
|
||||||
|
assert_complete_any "ipsec "
|
||||||
|
|
||||||
|
|
||||||
|
sync_after_int
|
||||||
|
|
||||||
|
|
||||||
|
teardown
|
Loading…
x
Reference in New Issue
Block a user