diff --git a/completions/vpnc b/completions/vpnc index 0465c31e..115aeb7a 100644 --- a/completions/vpnc +++ b/completions/vpnc @@ -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 diff --git a/test/completion/vpnc.exp b/test/completion/vpnc.exp new file mode 100644 index 00000000..29511b59 --- /dev/null +++ b/test/completion/vpnc.exp @@ -0,0 +1 @@ +assert_source_completions vpnc diff --git a/test/lib/completions/vpnc.exp b/test/lib/completions/vpnc.exp new file mode 100644 index 00000000..451d8093 --- /dev/null +++ b/test/lib/completions/vpnc.exp @@ -0,0 +1,18 @@ +proc setup {} { + save_env +} + + +proc teardown {} { + assert_env_unmodified +} + + +setup + + +assert_complete_any "vpnc -" +sync_after_int + + +teardown