[Bash-completion-commits] [SCM] bash-completion branch, master, updated. d05634409cc213ac085bda79592256d4748d78b6
Ville Skyttä
ville.skytta at iki.fi
Sun Apr 11 13:50:57 UTC 2010
The following commit has been merged in the master branch:
commit a44c07fb9e8436590183f56a3c49bbe1687d6cb7
Author: Ville Skyttä <ville.skytta at iki.fi>
Date: Sun Apr 11 16:40:34 2010 +0300
Add more iconv option completions, use _split_longopt.
diff --git a/CHANGES b/CHANGES
index 0340bc3..afbd2f1 100644
--- a/CHANGES
+++ b/CHANGES
@@ -25,10 +25,10 @@ bash-completion (2.x)
* Apply cardctl completion to pccardctl too.
* Apply pine completion to alpine too.
* Remove many unnecessary short option completions where long ones exist.
- * Improve chsh, chgrp, chown, configure, cvs, gkrellm, gzip, lftp, look,
- make, man, mdadm, modprobe, mplayer, mysqladmin, perldoc, rsync, screen,
- service, scp, ssh, sshfs, update-alternatives, vncviewer, yp-tools, and
- general hostname completions.
+ * Improve chsh, chgrp, chown, configure, cvs, gkrellm, gzip, iconv, lftp,
+ look, make, man, mdadm, modprobe, mplayer, mysqladmin, perldoc, rsync,
+ screen, service, scp, ssh, sshfs, update-alternatives, vncviewer, yp-tools,
+ and general hostname completions.
* Add abook and wtf completion, based on work by Raphaël Droz.
* Add cvsps, dragon, fusermount, jarsigner, k3b, lftpget, pm-utils, rtcwake,
pack200, unpack200, pbzip2, pbunzip2, pbzcat, pigz and unpigz completions.
diff --git a/contrib/iconv b/contrib/iconv
index 19a4c59..0a3cf60 100644
--- a/contrib/iconv
+++ b/contrib/iconv
@@ -3,24 +3,36 @@
have iconv &&
_iconv()
{
- local cur prev
+ local cur prev split=false
COMPREPLY=()
cur=`_get_cword`
prev=${COMP_WORDS[COMP_CWORD-1]}
+ _split_longopt && split=true
+
case $prev in
- -f|-t|--from-code|--to-code)
+ -'?'|--help|--usage|-V|--version|--unicode-subst|--byte-subst|\
+ --widechar-subst)
+ return 0
+ ;;
+ -f|--from-code|-t|--to-code)
COMPREPLY=( $( compgen -W \
'$( iconv --list | sed -e "s@//@@;" )' -- "$cur" ) )
return 0
;;
+ -o|--output)
+ _filedir
+ return 0
+ ;;
esac
+ $split && return 0
if [[ "$cur" = -* ]]; then
- COMPREPLY=( $( compgen -W '--from-code -f --to-code -t --list
- --output -o --verbose' -- "$cur" ) )
+ COMPREPLY=( $( compgen -W '--from-code --to-code --list -c
+ --unicode-subst --byte-subst --widechar-subst --output --silent
+ --verbose --help --usage --version' -- "$cur" ) )
return 0
fi
} &&
diff --git a/test/lib/completions/iconv.exp b/test/lib/completions/iconv.exp
index 0089533..420e923 100644
--- a/test/lib/completions/iconv.exp
+++ b/test/lib/completions/iconv.exp
@@ -11,7 +11,7 @@ proc teardown {} {
setup
-assert_complete_any "iconv "
+assert_complete_any "iconv -"
sync_after_int
--
bash-completion
More information about the Bash-completion-commits
mailing list