about summary refs log tree commit diff
path: root/Completion/Unix/Type/_bind_addresses
blob: 3460b7959ed36dde112a4fc703548f4d93710ec0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#autoload

local expl

case $OSTYPE in
  aix*) _hosts "$@" ;;
  darwin*|freebsd*|dragonfly*) _hosts "$@" ;;
  irix*) _hosts "$@" ;;
  # Couldn't find anything special for linux except for /proc/net/dev
  # Is there any proc file which gives the formatted ip?
  linux*) ;&
  *)
    _wanted bind-addresses expl 'bind address' compadd "$@" - \
      ${${${(M)${(f)"$(ifconfig -a)"}:#*addr:*}##*addr:( |)}%%(/| )*}
esac