[Bash-completion-commits] ./current r1202: Fixed perl -I/-x completion, thanks to Freddy Vulto

David Paleino d.paleino at gmail.com
Sat Nov 8 08:40:53 UTC 2008


------------------------------------------------------------
revno: 1202
committer: David Paleino <d.paleino at gmail.com>
branch nick: current
timestamp: Sat 2008-11-08 09:40:53 +0100
message:
  Fixed perl -I/-x completion, thanks to Freddy Vulto
  (Closes: #504547)
modified:
  bash_completion
  debian/changelog
-------------- next part --------------
=== modified file 'bash_completion'
--- a/bash_completion	2008-11-01 11:32:22 +0000
+++ b/bash_completion	2008-11-08 08:40:53 +0000
@@ -5295,24 +5295,28 @@
 _perl()
 {
     local cur prev prefix temp
+    local optPrefix optSuffix
 
     COMPREPLY=()
     cur=`_get_cword`
     prev=${COMP_WORDS[COMP_CWORD-1]}
     prefix=""
 
-    # completing an option (may or may not be separated by a space)
+    # If option not followed by whitespace, reassign prev and cur
     if [[ "$cur" == -?* ]]; then
 	temp=$cur
 	prev=${temp:0:2}
 	cur=${temp:2}
+	optPrefix=-P$prev
+	optSuffix=-S/
 	prefix=$prev
     fi
 
     # only handle module completion for now
     case "$prev" in
     -I|-x)
-    	COMPREPLY=( $( compgen -d -P "$prev" -- "$cur" ) )
+    	local IFS=$'\t\n'
+    	COMPREPLY=( $( compgen -d $optPrefix $optSuffix -- "$cur" ) )
     	return 0
     	;;
 	-m|-M)
@@ -5332,7 +5336,7 @@
 			-n -a -F -l -0 -I -m -M -P -S -x -i -e ' -- $cur ) )
     return 0
 }
-complete -F _perl $filenames perl
+complete -F _perl $nospace $filenames perl
 
 _perldoc()
 {

=== modified file 'debian/changelog'
--- a/debian/changelog	2008-11-01 11:32:22 +0000
+++ b/debian/changelog	2008-11-08 08:40:53 +0000
@@ -36,9 +36,11 @@
     sftp, thanks to Freddy Vulto (Closes: #504141)
   * Allow `Host(Name)' in ssh config file to be indented
   * Allow `Host(Name)' in ssh config file to have trailing comment.
+  * Fixed perl -I/-x completion, thanks to Freddy Vulto
+    (Closes: #504547)
   * debian/links fixed (Closes: #494292)
 
- -- David Paleino <d.paleino at gmail.com>  Sat, 01 Nov 2008 12:31:56 +0100
+ -- David Paleino <d.paleino at gmail.com>  Sat, 08 Nov 2008 09:39:48 +0100
 
 bash-completion (20080705) unstable; urgency=low
 



More information about the Bash-completion-commits mailing list