Complete MAC addresses also from /etc/ethers.

This commit is contained in:
Ville Skyttä 2010-10-23 21:42:00 +03:00
parent b31530f125
commit 5d7a13e05b
2 changed files with 5 additions and 0 deletions

View File

@ -28,6 +28,7 @@ bash-completion (2.x)
* Fixes to completions for filenames containing tabs (RedHat: #629518).
* Add *.m2t and *.m2ts to xine-based player filename completions
(Alioth: #312770).
* Add /etc/ethers to MAC address completion sources.
[ Freddy Vulto ]
* Added _tilde(), fix ~username completion (Alioth: #312613, Debian: #587095)

View File

@ -712,6 +712,10 @@ _mac_addresses()
"s/.*[[:space:]]\($re\)[[:space:]].*/\1/p" -ne \
"s/.*[[:space:]]\($re\)[[:space:]]*$/\1/p" ) )
# /etc/ethers
COMPREPLY=( "${COMPREPLY[@]}" $( sed -ne \
"s/^[[:space:]]*\($re\)[[:space:]].*/\1/p" /etc/ethers 2>/dev/null ) )
COMPREPLY=( $( compgen -W '${COMPREPLY[@]}' -- "$cur" ) )
__ltrim_colon_completions "$cur"
}