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()
{
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()