[Bash-completion-commits] [SCM] bash-completion branch, master, updated. 6e373da8e1c73f79d0ccbd723f170ec8e100caf2

Ville Skyttä ville.skytta at iki.fi
Tue Mar 30 17:50:41 UTC 2010


The following commit has been merged in the master branch:
commit 81d3c689a50316bef458244c8980649e1adaedd5
Author: Ville Skyttä <ville.skytta at iki.fi>
Date:   Tue Mar 30 20:29:42 2010 +0300

    Speed up process name completion.

diff --git a/bash_completion b/bash_completion
index f33a091..188a8b4 100644
--- a/bash_completion
+++ b/bash_completion
@@ -829,8 +829,8 @@ _pgids()
 [[ $UNAME == SunOS || $UNAME == AIX ]] &&
 _pnames()
 {
-    COMPREPLY=( $( compgen -W '$( command ps -efo comm | \
-        sed -e 1d -e "s:.*/::" -e "s/^-//" -e "s/^<defunct>$//")' -- "$cur" ) )
+    COMPREPLY=( $( compgen -X '<defunct>' -W '$( command ps -efo comm | \
+        sed -e 1d -e "s:.*/::" -e "s/^-//" | sort -u )' -- "$cur" ) )
 } ||
 _pnames()
 {
@@ -842,9 +842,9 @@ _pnames()
     # for now.
     # Not using "ps axo comm" because under some Linux kernels, it
     # truncates command names (see e.g. http://bugs.debian.org/497540#19)
-    COMPREPLY=( $( compgen -W '$( command ps axo command= | \
+    COMPREPLY=( $( compgen -X '<defunct>' -W '$( command ps axo command= | \
         sed -e "s/ .*//" -e "s:.*/::" -e "s/:$//" -e "s/^[[(-]//" \
-            -e "s/[])]$//" -e "s/^<defunct>$//")' -- "$cur" ) )
+            -e "s/[])]$//" | sort -u )' -- "$cur" ) )
 }
 
 # This function completes on user IDs

-- 
bash-completion



More information about the Bash-completion-commits mailing list