diff options
author | Ville Skyttä <ville.skytta@iki.fi> | 2011-08-23 20:26:06 +0300 |
---|---|---|
committer | Ville Skyttä <ville.skytta@iki.fi> | 2011-08-23 20:26:06 +0300 |
commit | bae99345fdd1297ebb31ab910a8cb063a359b43c (patch) | |
tree | eaf25c2f7ae2091c1beb6b8f62a32caf560d7282 | |
parent | bff86775992a2e321863dfe38a9f0b1f4a8f471d (diff) | |
download | bash-completion-bae99345fdd1297ebb31ab910a8cb063a359b43c.tar.gz |
idn: New completion.
-rw-r--r-- | completions/Makefile.am | 1 | ||||
-rw-r--r-- | completions/idn | 32 | ||||
-rw-r--r-- | test/completion/idn.exp | 1 | ||||
-rw-r--r-- | test/lib/completions/idn.exp | 20 |
4 files changed, 54 insertions, 0 deletions
diff --git a/completions/Makefile.am b/completions/Makefile.am index 038959e2..0cfea794 100644 --- a/completions/Makefile.am +++ b/completions/Makefile.am @@ -67,6 +67,7 @@ bashcomp_DATA = abook \ hping2 \ htpasswd \ iconv \ + idn \ iftop \ ifupdown \ imagemagick \ diff --git a/completions/idn b/completions/idn new file mode 100644 index 00000000..fba95f03 --- /dev/null +++ b/completions/idn @@ -0,0 +1,32 @@ +have idn || return + +_idn() +{ + local cur prev words cword split + _init_completion -s || return + + case $prev in + -h|--help|-V|--version) + return + ;; + -p|--profile) + COMPREPLY=( $( compgen -W 'Nameprep iSCSI Nodeprep Resourceprep + trace SASLprep' -- "$cur" ) ) + return + ;; + esac + + if ! $split && [[ $cur == -* ]]; then + COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + [[ $COMPREPLY == *= ]] && compopt -o nospace + fi +} && +complete -F _idn idn + +# 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 diff --git a/test/completion/idn.exp b/test/completion/idn.exp new file mode 100644 index 00000000..5fccae3d --- /dev/null +++ b/test/completion/idn.exp @@ -0,0 +1 @@ +assert_source_completions idn diff --git a/test/lib/completions/idn.exp b/test/lib/completions/idn.exp new file mode 100644 index 00000000..4625c7e4 --- /dev/null +++ b/test/lib/completions/idn.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +} + + +proc teardown {} { + assert_env_unmodified +} + + +setup + + +assert_complete_any "idn -" + + +sync_after_int + + +teardown |