From bffce4218e33bc61c0551b87e4b5bfbb41ad4223 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Mon, 25 Jun 2012 17:44:11 +0300 Subject: [PATCH] wsimport: New completion. --- completions/Makefile.am | 1 + completions/wsimport | 49 +++++++++++++++++++++++++++++++ test/completion/wsimport.exp | 1 + test/lib/completions/wsimport.exp | 18 ++++++++++++ 4 files changed, 69 insertions(+) create mode 100644 completions/wsimport create mode 100644 test/completion/wsimport.exp create mode 100644 test/lib/completions/wsimport.exp diff --git a/completions/Makefile.am b/completions/Makefile.am index 2a884e9e..81c5e537 100644 --- a/completions/Makefile.am +++ b/completions/Makefile.am @@ -333,6 +333,7 @@ bashcomp_DATA = a2x \ withlist \ wodim \ wol \ + wsimport \ wtf \ wvdial \ xfreerdp \ diff --git a/completions/wsimport b/completions/wsimport new file mode 100644 index 00000000..91504844 --- /dev/null +++ b/completions/wsimport @@ -0,0 +1,49 @@ +# wsimport(1) completion -*- shell-script -*- + +_wsimport() +{ + local cur prev words cword + _init_completion -n : || return + + case $prev in + -help|-version|-B|-p|-wsdllocation) + return + ;; + -b) + _filedir '@(xml|xjb)' + return + ;; + -catalog) + _filedir '@(xml|soc|catalog)' + return + ;; + -d|–s) + _filedir -d + return + ;; + -target) + COMPREPLY=( $( compgen -W '2.0 2.1 2.2' -- "$cur" ) ) + return + ;; + -clientjar) + _filedir jar + return + ;; + esac + + if [[ $cur == -httpproxy:* ]]; then + _known_hosts_real "${cur#-httpproxy:}" + return + elif [[ $cur == -* ]]; then + COMPREPLY=( $( compgen -W '$( _parse_help "$1" -help )' \ + -- "$cur" ) ) + [[ $COMPREPLY == *: ]] && compopt -o nospace + __ltrim_colon_completions "$cur" + return + fi + + _filedir wsdl +} && +complete -F _wsimport wsimport + +# ex: ts=4 sw=4 et filetype=sh diff --git a/test/completion/wsimport.exp b/test/completion/wsimport.exp new file mode 100644 index 00000000..3f889e26 --- /dev/null +++ b/test/completion/wsimport.exp @@ -0,0 +1 @@ +assert_source_completions wsimport diff --git a/test/lib/completions/wsimport.exp b/test/lib/completions/wsimport.exp new file mode 100644 index 00000000..36bf35c1 --- /dev/null +++ b/test/lib/completions/wsimport.exp @@ -0,0 +1,18 @@ +proc setup {} { + save_env +} + + +proc teardown {} { + assert_env_unmodified +} + + +setup + + +assert_complete_any "wsimport " +sync_after_int + + +teardown