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

Re: PATCH: _hosts, _hostports, _telnet and _socket



Tanaka Akira wrote:
> `_telnet' uses AA named `telent_ports' to complete hosts and ports ---
> keys for hosts and (word splitted) values for ports.
> (If the host completion is failed, `_hosts' is called.)

Just some random ideas.

I'd have said there was room for an autoloaded function _ports, which can
use telnet_ports and then default to something like
  awk '/^[a-z]/ { print $1 }' /etc/services
if nothing turns up.  As Bart implied, it might be useful to have it
index on commands, too:  you could have the convention, say, that
commands had a trailing * added (quoted, obviously).  Then _ports
could be called like "_ports <cmd> <host>".  You could make it search
the assoc array <cmd>_ports, which is sort of what's happening with
telnet_ports and socket_ports.  In that case indexing on commands is
perhaps superflous and you could have a special key (e.g. '*') giving
a default port.
-- 
Peter Stephenson <pws@xxxxxxxxxxxxxxxxx>       Tel: +39 050 844536
WWW:  http://www.ifh.de/~pws/
Dipartimento di Fisica, Via Buonarroti 2, 56100 Pisa, Italy



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