2005-03-07 19:59:33 +01:00
|
|
|
#compdef iwconfig
|
|
|
|
|
2005-06-24 16:48:52 +02:00
|
|
|
local curcontext="$curcontext" state line expl ret=1
|
2005-03-07 19:59:33 +01:00
|
|
|
|
2005-06-24 16:48:52 +02:00
|
|
|
_arguments -C \
|
|
|
|
'(1 * -)--help[display help information]' \
|
|
|
|
'(1 * -)--version[display version information]' \
|
|
|
|
'1:network interface:_net_interfaces' \
|
|
|
|
'*:parameter:->parameters' && ret=0
|
2005-03-07 19:59:33 +01:00
|
|
|
|
2005-06-24 16:48:52 +02:00
|
|
|
if [[ -n "$state" ]]; then
|
|
|
|
local -a arg
|
2005-03-07 19:59:33 +01:00
|
|
|
|
2005-06-24 16:48:52 +02:00
|
|
|
case $words[CURRENT-1] in
|
|
|
|
essid) _wanted -x names expl 'network name' compadd off any on ;;
|
|
|
|
nwid|domain) _message -e ids 'network id' ;;
|
|
|
|
freq|channel) _message -e channels 'channel or frequency' ;;
|
|
|
|
sens) _message -e levels 'signal level' ;;
|
|
|
|
mode)
|
|
|
|
_wanted modes expl 'operating mode' compadd \
|
|
|
|
Ad-Hoc Managed Master Repeater Secondary Monitor Auto
|
|
|
|
;;
|
|
|
|
ap) _message -e access-points 'access point' ;;
|
|
|
|
nick*) _message -e names 'nickname' ;;
|
|
|
|
rate|bit*) _message -e bit-rates 'bit rate' ;;
|
|
|
|
rts*|frag*) _message -e sizes 'size' ;;
|
|
|
|
key|enc*) _message -e keys 'key' ;;
|
|
|
|
power)
|
|
|
|
arg=(
|
|
|
|
\*{min,max}'[modifier]'
|
|
|
|
'*off[disable power management]'
|
|
|
|
'*on[enable power management]'
|
|
|
|
'*all[receive all packets]'
|
|
|
|
'unicast[receive unicast packets only]'
|
|
|
|
'multicast[receive multicast and broadcast packets only]'
|
|
|
|
)
|
|
|
|
;&
|
|
|
|
min|max)
|
|
|
|
_values -S ' ' -w 'parameter' \
|
|
|
|
'period[set the period between wake ups]' \
|
|
|
|
'timeout[set timeout before sleep]' \
|
|
|
|
$arg[@] && ret=0
|
|
|
|
;;
|
|
|
|
period|timeout) _message -e timeouts 'timeout' ;;
|
|
|
|
txpower) _message -e power 'transmit power' ;;
|
|
|
|
retry) _message -e retries 'retries' ;;
|
|
|
|
*)
|
|
|
|
_values -S ' ' -w 'option' \
|
|
|
|
'essid[set the network name]' \
|
|
|
|
'(nwid domain)'{nwid,domain}'[set the network ID]' \
|
|
|
|
'(freq channel)'{freq,channel}'[set the operating frequency or channel]' \
|
|
|
|
'sens[set the sensitivity threhold]' \
|
|
|
|
'mode[set operating mode]' \
|
|
|
|
'ap[register with given access point]' \
|
|
|
|
'(nick nickname)'nick{,name}'[set the nickname]' \
|
|
|
|
'(rate bit)'{rate,bit}'[set the bitrate]' \
|
|
|
|
'rts[set packet size threshold for sending RTS]' \
|
|
|
|
'frag[set maximum packet fragment size]' \
|
|
|
|
\*{key,enc}'[add encryption key]' \
|
|
|
|
'*power[manipulate power management scheme parameters]' \
|
|
|
|
'txpower[set transmit power]' \
|
|
|
|
'retry[set number of retries]' \
|
|
|
|
'commit[apply changes imediately]' && ret=0
|
2005-03-07 19:59:33 +01:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
fi
|
2005-06-24 16:48:52 +02:00
|
|
|
|
|
|
|
return ret
|