Bug#443394: bash: [completion] Perl completion doesn't complete filenames past 1st

2008-02-07 Thread Kevin Locke
The patch proposed in the initial bug report has the problem that
since -* is stripped off of $cur and placed in $prev in the opening
lines of the _perl function, the test will always be true.

I have attached my approach to the same problem, with the addition of
completing -I and -x arguments (which may easily be ignored if
considered unnecessary).

Cheers,
Kevin
--- bash_completion.old 2008-02-07 01:28:45.0 -0700
+++ bash_completion 2008-02-07 01:40:41.0 -0700
@@ -5188,6 +5188,10 @@
 
 # only handle module completion for now
 case $prev in
+   -I|-x)
+   COMPREPLY=( $( compgen -d -P $prev -- $cur ) )
+   return 0
+   ;;
-m|-M)
_perlmodules
return 0
@@ -5195,7 +5199,7 @@
 esac
 
 # handle case where first parameter is not a dash option
-if [ $COMP_CWORD -eq 1 ]  [[ $cur != -* ]]; then
+if [[ ${COMP_WORDS[COMP_CWORD]} != -* ]]; then
_filedir
return 0
 fi


Bug#443394: bash: [completion] Perl completion doesn't complete filenames past 1st argument

2007-09-20 Thread David Caldwell
Package: bash
Version: 3.1dfsg-8
Severity: normal


Bash completion by default doesn't try to complete filenames on
arguments other than the very first one. This behavior is very
annoying.

The following patch fixes the problem:

--- bash_completion.orig2007-09-20 18:24:14.0 -0700
+++ bash_completion 2007-09-20 18:24:30.0 -0700
@@ -5195,7 +5195,7 @@
 esac
 
 # handle case where first parameter is not a dash option
-if [ $COMP_CWORD -eq 1 ]  [[ $cur != -* ]]; then
+if [[ $cur != -* ]]; then
_filedir
return 0
 fi

Thanks,
  David

-- System Information:
Debian Release: lenny/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)

Kernel: Linux 2.6.22-1-686 (SMP w/2 CPU cores)
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Shell: /bin/sh linked to /bin/bash

Versions of packages bash depends on:
ii  base-files4.0.0  Debian base system miscellaneous f
ii  debianutils   2.23.1 Miscellaneous utilities specific t
ii  libc6 2.6.1-1+b1 GNU C Library: Shared libraries
ii  libncurses5   5.6+20070812-1 Shared libraries for terminal hand

bash recommends no packages.

-- no debconf information



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]