[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 d05634409cc213ac085bda79592256d4748d78b6
Author: Ville Skyttä <ville.skytta at iki.fi>
Date:   Sun Apr 11 16:49:50 2010 +0300

    Make iconv encoding completion more portable.

diff --git a/contrib/iconv b/contrib/iconv
index 0a3cf60..959ce40 100644
--- a/contrib/iconv
+++ b/contrib/iconv
@@ -17,8 +17,8 @@ _iconv()
             return 0
             ;;
         -f|--from-code|-t|--to-code)
-            COMPREPLY=( $( compgen -W \
-                '$( iconv --list | sed -e "s@//@@;" )' -- "$cur" ) )
+            COMPREPLY=( $( compgen -W '$( iconv -l | \
+                sed -e "s@/*\$@@" -e "s/[,()]//g" )' -- "$cur" ) )
             return 0
             ;;
         -o|--output)
@@ -37,6 +37,8 @@ _iconv()
     fi
 } &&
 complete -F _iconv -o default iconv
+# Intentionally not -o filenames here, -f/-t completions may contain slashes
+# and -o filenames would break them.
 
 # Local variables:
 # mode: shell-script

-- 
bash-completion



More information about the Bash-completion-commits mailing list