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

This commit is contained in:
Ville Skyttä 2009-06-12 20:14:10 +03:00
parent 9a7c9804f2
commit 0d78b4913f

View File

@ -7,15 +7,15 @@ have hcitool && {
_bluetooth_adresses() _bluetooth_adresses()
{ {
if [ -n "${COMP_BLUETOOTH_SCAN:-}" ]; then if [ -n "${COMP_BLUETOOTH_SCAN:-}" ]; then
COMPREPLY=( ${COMPREPLY[@]:-} $( hcitool scan | \ COMPREPLY=( ${COMPREPLY[@]:-} $( compgen -W "$( hcitool scan | \
awk '/^\t/{print $1}' | grep "^$cur" ) ) awk '/^\t/{print $1}' )" -- $cur ) )
fi fi
} }
_bluetooth_devices() _bluetooth_devices()
{ {
COMPREPLY=( ${COMPREPLY[@]:-} $( hcitool dev | \ COMPREPLY=( ${COMPREPLY[@]:-} $( compgen -W "$( hcitool dev | \
awk '/^\t/{print $1}' | grep "^$cur" ) ) awk '/^\t/{print $1}' )" -- $cur ) )
} }
_bluetooth_services() _bluetooth_services()