vpnc: Use _parse_help instead of hardcoding options, add basic test case.
This commit is contained in:
parent
eb396b58a7
commit
e4796104bc
@ -25,12 +25,8 @@ _vpnc()
|
||||
esac
|
||||
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W '--version --print-config --help \
|
||||
--long-help --gateway --id --username --udp --domain \
|
||||
--xauth-inter --script --dh --pfs --enable-1des \
|
||||
--application-version --ifname --debug --no-detach \
|
||||
--pid-file --local-port --udp-port --disable-natt \
|
||||
--non-inter' -- "$cur" ) )
|
||||
COMPREPLY=( $( compgen -W '$( _parse_help "$1" --long-help )' \
|
||||
-- "$cur" ) )
|
||||
else
|
||||
COMPREPLY=( $( compgen -W '$( command ls /etc/vpnc )' -- "$cur" ) )
|
||||
fi
|
||||
|
1
test/completion/vpnc.exp
Normal file
1
test/completion/vpnc.exp
Normal file
@ -0,0 +1 @@
|
||||
assert_source_completions vpnc
|
18
test/lib/completions/vpnc.exp
Normal file
18
test/lib/completions/vpnc.exp
Normal file
@ -0,0 +1,18 @@
|
||||
proc setup {} {
|
||||
save_env
|
||||
}
|
||||
|
||||
|
||||
proc teardown {} {
|
||||
assert_env_unmodified
|
||||
}
|
||||
|
||||
|
||||
setup
|
||||
|
||||
|
||||
assert_complete_any "vpnc -"
|
||||
sync_after_int
|
||||
|
||||
|
||||
teardown
|
Loading…
x
Reference in New Issue
Block a user