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

Ville Skyttä ville.skytta at iki.fi
Fri Jun 12 17:27:01 UTC 2009


The following commit has been merged in the master branch:
commit 0d78b4913f5cec8f576f2ce870b165a0923fcc74
Author: Ville Skyttä <ville.skytta at iki.fi>
Date:   Fri Jun 12 20:14:10 2009 +0300

    Use compgen -W instead of grepping $cur in bluez-utils.

diff --git a/contrib/bluez-utils b/contrib/bluez-utils
index 4b35ff4..f222323 100644
--- a/contrib/bluez-utils
+++ b/contrib/bluez-utils
@@ -7,15 +7,15 @@ have hcitool && {
 _bluetooth_adresses()
 {
 	if [ -n "${COMP_BLUETOOTH_SCAN:-}" ]; then
-		COMPREPLY=( ${COMPREPLY[@]:-} $( hcitool scan | \
-			awk '/^\t/{print $1}' | grep "^$cur" ) )
+		COMPREPLY=( ${COMPREPLY[@]:-} $( compgen -W "$( hcitool scan | \
+			awk '/^\t/{print $1}' )" -- $cur ) )
 	fi
 }
 
 _bluetooth_devices()
 {
-	COMPREPLY=( ${COMPREPLY[@]:-} $( hcitool dev | \
-		awk '/^\t/{print $1}' | grep "^$cur" ) )
+	COMPREPLY=( ${COMPREPLY[@]:-} $( compgen -W "$( hcitool dev | \
+		awk '/^\t/{print $1}' )" -- $cur ) )
 }
 
 _bluetooth_services()

-- 
bash-completion



More information about the Bash-completion-commits mailing list