1
0
mirror of git://git.code.sf.net/p/zsh/code synced 2024-09-28 15:01:21 +02:00

22811: helper function to give local IP addresses to which a program might bind a socket.

This commit is contained in:
Clint Adams 2006-10-03 16:20:24 +00:00
parent 4b65fe8966
commit 39a2fe325b
2 changed files with 19 additions and 0 deletions

@ -1,5 +1,9 @@
2006-10-03 Clint Adams <clint@zsh.org>
* 22811: R. Ramkumar: Completion/Unix/Type/_bind_addresses:
helper function to give local IP addresses to which a program
might bind a socket.
* 22810: Completion/Unix/Command/_gpg: fix malformed
--encrypt-to line.

@ -0,0 +1,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