about summary refs log tree commit diff
path: root/Completion/Linux/Command/_iwconfig
blob: 5957a7603a44e840502d549d8b832e9402962b5a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#compdef iwconfig

local iwparams prevword expl

iwparams=(
essid nwid freq channel sens mode ap nick rate rts frag txpower enc
key power retry
)

if (( CURRENT == 2 )); then
  _net_interfaces || compadd -- --help --version
  return
fi

prevword="$words[CURRENT-1]"

if [[ -n ${iwparams[(r)$prevword]} ]]; then
  case "$prevword" in
    (mode)
      _wanted tag expl 'operating mode' \
        compadd Ad-Hoc Managed Master Repeater Secondary Monitor Auto
    ;;
    (*)
      _wanted tag expl "$prevword value" \
        compadd off
  esac
else
  _wanted tag expl 'iwconfig parameter' compadd $iwparams commit
fi