Split iconv completion to contrib/iconv

This commit is contained in:
David Paleino 2009-06-05 08:25:08 +02:00
parent 6a9c2b191b
commit fe1e044ed1
4 changed files with 29 additions and 28 deletions

View File

@ -14,6 +14,7 @@ bash-completion (1.x)
* Don't assume "sed" being GNU sed, use "gsed" whenever available * Don't assume "sed" being GNU sed, use "gsed" whenever available
(Debian: #501479, Alioth: #311393) (Debian: #501479, Alioth: #311393)
* Split mutt completion to contrib/mutt * Split mutt completion to contrib/mutt
* Split iconv completion to contrib/iconv
[ Ville Skyttä ] [ Ville Skyttä ]
* Split yum and yum-arch completion into contrib/yum. * Split yum and yum-arch completion into contrib/yum.

View File

@ -34,6 +34,7 @@ bashcomp_DATA = contrib/ant \
contrib/gzip \ contrib/gzip \
contrib/harbour \ contrib/harbour \
contrib/heimdal \ contrib/heimdal \
contrib/iconv \
contrib/imagemagick \ contrib/imagemagick \
contrib/info \ contrib/info \
contrib/iptables \ contrib/iptables \

View File

@ -3204,34 +3204,6 @@ _ypmatch()
} && } &&
complete -F _ypmatch ypmatch ypcat complete -F _ypmatch ypmatch ypcat
# iconv(1) completion
#
have iconv &&
_iconv()
{
local cur prev
COMPREPLY=()
cur=`_get_cword`
prev=${COMP_WORDS[COMP_CWORD-1]}
case "$prev" in
-@(f|t|-@(from|to)-code))
COMPREPLY=( $( compgen -W \
'$( iconv --list | sed -e "s@//@@;" )' -- "$cur" ) )
return 0
;;
esac
if [[ "$cur" = -* ]]; then
COMPREPLY=( $( compgen -W '--from-code -f --to-code -t --list
--output -o --verbose' -- "$cur" ) )
return 0
fi
} &&
complete -F _iconv $default iconv
# dict(1) completion # dict(1) completion
# #
{ have dict || have rdict; } && { { have dict || have rdict; } && {

27
contrib/iconv Normal file
View File

@ -0,0 +1,27 @@
# iconv(1) completion
#
have iconv &&
_iconv()
{
local cur prev
COMPREPLY=()
cur=`_get_cword`
prev=${COMP_WORDS[COMP_CWORD-1]}
case "$prev" in
-@(f|t|-@(from|to)-code))
COMPREPLY=( $( compgen -W \
'$( iconv --list | sed -e "s@//@@;" )' -- "$cur" ) )
return 0
;;
esac
if [[ "$cur" = -* ]]; then
COMPREPLY=( $( compgen -W '--from-code -f --to-code -t --list
--output -o --verbose' -- "$cur" ) )
return 0
fi
} &&
complete -F _iconv $default iconv