[Bash-completion-commits] [SCM] bash-completion branch, master, updated. 1.3-235-g26ae770

Igor Murzov igor at gplsoft.org
Mon May 2 10:27:01 UTC 2011


The following commit has been merged in the master branch:
commit 1a7f095d95c58d82ac14b47f03fd38c92325a394
Author: Igor Murzov <igor at gplsoft.org>
Date:   Mon Jul 5 13:40:39 2010 +0400

    Improve package name completion

diff --git a/contrib/slackware b/contrib/slackware
index 486e747..6e43c97 100644
--- a/contrib/slackware
+++ b/contrib/slackware
@@ -62,8 +62,11 @@ _slapt-get()
 
     case $t in
         all) # --install|-i|--show|--filelist
-            COMPREPLY=( $( slapt-get --search "^$cur" 2> /dev/null | \
-                awk '{print $1}' ) )
+            # slapt-get will fail to search for "^orc-0.4.4" for example
+            # it can only search for names, so we should anything else
+            local name=$( echo $cur | cut -f1 -d- )
+            COMPREPLY=( $( slapt-get --search "^$name" 2> /dev/null | \
+                awk '{print $1}' | grep "^$cur" ) )
             return 0
             ;;
         ins) # --remove

-- 
bash-completion



More information about the Bash-completion-commits mailing list