new helper functions:

- _usb_ids completes on USB ids
- _pci_ids completes on PCI ids
master
Guillaume Rousse 2009-02-10 23:50:04 +01:00
parent 9e08218fb9
commit 935295c280
1 changed files with 16 additions and 0 deletions

View File

@ -522,6 +522,22 @@ _count_args()
done
}
# This function complete on PCI IDs
#
_pci_ids()
{
COMPREPLY=( ${COMPREPLY[@]:-} \
$( compgen -W "$( lspci -n | awk '{print $3}')" -- $cur ) )
}
# This function complete on USB IDs
#
_usb_ids()
{
COMPREPLY=( ${COMPREPLY[@]:-} \
$( compgen -W "$( lsusb | awk '{print $6}')" -- $cur ) )
}
# start of section containing completion functions for bash built-ins
# bash alias completion