Sophie

Sophie

distrib > * > 2008.0 > x86_64 > by-pkgid > 2e3acf97b6e69efb5b02391cf9118779 > files > 9

bash-completion-20060301-18mdv2008.0.src.rpm

--- /etc/bash_completion	2007-03-05 14:59:23.000000000 +0100
+++ bash_completion	2007-06-15 15:01:28.000000000 +0200
@@ -5229,16 +5229,12 @@
 	    ;;
     esac
 
-    # handle case where first parameter is not a dash option
-    if [ $COMP_CWORD -eq 1 ] && [[ "$cur" != -* ]]; then
+    if [[ "$cur" == -* ]]; then
+	COMPREPLY=( $( compgen -W '-C -s -T -u -U -W -X -h -v -V -c -w -d -D \
+	    -p -n -a -F -l -0 -I -m -M -P -S -x -i -e ' -- $cur ) )
+    else
 	_filedir
-	return 0
     fi
-
-    # complete using basic options
-    COMPREPLY=( $( compgen -W '-C -s -T -u -U -W -X -h -v -V -c -w -d -D -p \
-			-n -a -F -l -0 -I -m -M -P -S -x -i -e ' -- $cur ) )
-    return 0
 }
 complete -F _perl $filenames perl
 
@@ -5295,21 +5291,16 @@
 	    ;;
     esac
 
-    case $cur in
-	-*)
+    if [[ "$cur" == -* ]]; then
 	    COMPREPLY=( $( compgen -W '-h -v -t -u -m -l -F -X -f -q' -- $cur ))
-	    return 0
-	    ;;
-	*/*)
-	    return 0
-	    ;;
-	*)
-	    _perlmodules
-	    COMPREPLY=( ${COMPREPLY[@]} $( compgen -W '$( PAGER=cat man perl 2>/dev/null | sed -ne "/perl.*Perl overview/,/perlwin32/s/^[^a-z0-9]*\([a-z0-9]*\).*$/\1/p")' -- $cur ) )
-
-	    return 0
-	    ;;
-    esac
+    else
+	# return available modules (unless it is clearly a file)
+	if [[ "$cur" != */* ]]; then
+		_perlmodules
+		COMPREPLY=( ${COMPREPLY[@]} $( compgen -W '$( PAGER=cat man perl 2>/dev/null | sed -ne "/perl.*Perl overview/,/perlwin32/s/^[^a-z0-9]*\([a-z0-9]*\).*$/\1/p")' -- $cur ) )
+	fi
+	_filedir
+    fi
 }
 complete -F _perldoc $default perldoc
 }