From 39a2fe325bdae1da860cdb39a7b349c37ed4f3df Mon Sep 17 00:00:00 2001 From: Clint Adams Date: Tue, 3 Oct 2006 16:20:24 +0000 Subject: 22811: helper function to give local IP addresses to which a program might bind a socket. --- Completion/Unix/Type/_bind_addresses | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 Completion/Unix/Type/_bind_addresses (limited to 'Completion/Unix/Type/_bind_addresses') diff --git a/Completion/Unix/Type/_bind_addresses b/Completion/Unix/Type/_bind_addresses new file mode 100644 index 000000000..606de3ffb --- /dev/null +++ b/Completion/Unix/Type/_bind_addresses @@ -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 -- cgit 1.4.1