idn: New completion.
This commit is contained in:
parent
bff8677599
commit
bae99345fd
@ -67,6 +67,7 @@ bashcomp_DATA = abook \
|
|||||||
hping2 \
|
hping2 \
|
||||||
htpasswd \
|
htpasswd \
|
||||||
iconv \
|
iconv \
|
||||||
|
idn \
|
||||||
iftop \
|
iftop \
|
||||||
ifupdown \
|
ifupdown \
|
||||||
imagemagick \
|
imagemagick \
|
||||||
|
32
completions/idn
Normal file
32
completions/idn
Normal file
@ -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
|
1
test/completion/idn.exp
Normal file
1
test/completion/idn.exp
Normal file
@ -0,0 +1 @@
|
|||||||
|
assert_source_completions idn
|
20
test/lib/completions/idn.exp
Normal file
20
test/lib/completions/idn.exp
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
proc setup {} {
|
||||||
|
save_env
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
proc teardown {} {
|
||||||
|
assert_env_unmodified
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
setup
|
||||||
|
|
||||||
|
|
||||||
|
assert_complete_any "idn -"
|
||||||
|
|
||||||
|
|
||||||
|
sync_after_int
|
||||||
|
|
||||||
|
|
||||||
|
teardown
|
Loading…
x
Reference in New Issue
Block a user