[Bash-completion-commits] [SCM] bash-completion branch, master, updated. 3a69bd3e9379f8092d4cb69f1f83fcfeb98aa537

David Paleino d.paleino at gmail.com
Thu Sep 17 20:33:29 UTC 2009


The following commit has been merged in the master branch:
commit f13ea4968bc11c69fb1f0cc88aa95dceb928ca56
Author: David Paleino <d.paleino at gmail.com>
Date:   Thu Sep 17 22:15:13 2009 +0200

    Avoid sed pipe as ps itself can omit the headers (thanks to Elan Ruusamäe)

diff --git a/CHANGES b/CHANGES
index 3b08b10..b0beae8 100644
--- a/CHANGES
+++ b/CHANGES
@@ -36,6 +36,8 @@ bash-completion (1.x)
   * Improve qemu completion (Debian: #534901)
   * Added sshfs completion (shares the same as scp) (Debian: #545978)
   * Fixed obvious brokenness (typos) in contrib/mdadm
+  * Patches from PLD Linux (thanks to Elan Ruusamäe):
+    - avoid sed pipe as ps itself can omit the headers
 
   [ Ville Skyttä ]
   * Split yum completion to contrib/_yum (no longer installed by default, the
diff --git a/bash_completion b/bash_completion
index 07fe78c..58731b5 100644
--- a/bash_completion
+++ b/bash_completion
@@ -445,7 +445,7 @@ _pids()
 } ||
 _pids()
 {
-	COMPREPLY=( $( compgen -W '$( command ps axo pid | sed 1d )' -- $cur ) )
+	COMPREPLY=( $( compgen -W '$( command ps axo pid= )' -- $cur ) )
 }
 
 # This function completes on process group IDs.
@@ -457,7 +457,7 @@ _pgids()
 } ||
 _pgids()
 {
-	COMPREPLY=( $( compgen -W '$( command ps axo pgid | sed 1d )' -- $cur ))
+	COMPREPLY=( $( compgen -W '$( command ps axo pgid= )' -- $cur ))
 }
 
 # This function completes on process names.
@@ -480,8 +480,8 @@ _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 | \
-			           sed -e "1d; s/ .*//; s:.*/::; s/:$//;" \
+	COMPREPLY=( $( compgen -W '$( command ps axo command= | \
+			           sed -e "s/ .*//; s:.*/::; s/:$//;" \
 			               -e "s/^[[(-]//; s/[])]$//" \
 				       -e "s/^<defunct>$//")' \
 			           -- $cur ) )

-- 
bash-completion



More information about the Bash-completion-commits mailing list