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

Hosts completion



Following is a replacement for the hosts completion. I've added an initial
line which attempts to set $hosts if it isn't already and I've added
matching control: host names are not case-sensitive so should be treated as
such and it's useful if '.' is treated as special like '/' in path names.
I've also added telnet and xhost to the list of commands to work on.
Host names isn't the perfect completion for them but they haven't got a
better completion yet.

Oliver Kiddle

#compdef ftp ncftp ping rwho rup xping traceroute nslookup telnet xhost

: ${(A)hosts:=${${(s: :)${(ps:\t:)${${(f)"$(</etc/hosts)"}%%\#*}##[\t ]#[^\t
]#}}}}

compgen -M 'm:{a-zA-Z}={A-Za-z} r:|.=* r:|=*' -k hosts



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