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:
parent
4b65fe8966
commit
39a2fe325b
@ -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.
|
||||
|
||||
|
15
Completion/Unix/Type/_bind_addresses
Normal file
15
Completion/Unix/Type/_bind_addresses
Normal file
@ -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
|
Loading…
Reference in New Issue
Block a user