Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

PATCH: _bind_addresses



From R.Ramkumar.  Obviously it could be improved.

Index: Completion/Unix/Type/_bind_addresses
===================================================================
RCS file: Completion/Unix/Type/_bind_addresses
diff -N Completion/Unix/Type/_bind_addresses
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ Completion/Unix/Type/_bind_addresses	3 Oct 2006 16:16:30 -0000
@@ -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



Messages sorted by: Reverse Date, Date, Thread, Author