Fixed "freq" and "rate" completion for iwconfig

Should be tested on bash < 4; on bash4 it gave:

    awk: /^[[:space:]]*Channel/ {print $4\"G\"}
    awk:                                 ^ backslash not last character on line

  (similarly for "rate")
This commit is contained in:
David Paleino 2009-10-12 13:01:28 +02:00
parent bb8912b06f
commit dbb3510524
2 changed files with 3 additions and 2 deletions

View File

@ -4,6 +4,7 @@ bash-completion (1.x)
* Don't use pidof in _known_hosts_real() to detect whether Avahi is
available, since it's not available on MacOS X. Thanks to Rainer
Müller <raimue@codingfarm.de> (bash-completion MacPorts maintainer)
* Fixed "freq" and "rate" completion for iwconfig
-- David Paleino <d.paleino@gmail.com> Sun, 11 Oct 2009 11:11:57 +0200

View File

@ -39,7 +39,7 @@ _iwconfig()
freq)
COMPREPLY=( $( compgen -W "$( iwlist ${COMP_WORDS[1]} channel | \
awk '/^[[:space:]]*Channel/ {print $4\"G\"}')" -- "$cur" ) )
awk '/^[[:space:]]*Channel/ {print $4"G"}')" -- "$cur" ) )
return 0
;;
ap)
@ -55,7 +55,7 @@ _iwconfig()
COMPREPLY=( $( compgen -W 'auto fixed' -- "$cur" ) )
COMPREPLY=( "${COMPREPLY[@]}" $( compgen -W \
"$( iwlist ${COMP_WORDS[1]} rate | \
awk '/^[[:space:]]*[0-9]/ {print $1\"M\"}' )" -- "$cur" ) )
awk '/^[[:space:]]*[0-9]/ {print $1"M"}' )" -- "$cur" ) )
return 0
;;
rts|frag)