* bad behaviour for _ports ?
@ 2009-11-12 11:03 Baptiste Daroussin
0 siblings, 0 replies; only message in thread
From: Baptiste Daroussin @ 2009-11-12 11:03 UTC (permalink / raw)
To: zsh-workers
[-- Attachment #1: Type: text/plain, Size: 297 bytes --]
Hi all
The actual _ports has a strange behaviour (at least it seems to me) it add to
completion only the name of the services not the ports number which make it not
very usefull.
If that's a wanted feature forget about this mail, if not, here is a version I
propose to replace it
regards,
Bapt
[-- Attachment #2: _ports --]
[-- Type: text/plain, Size: 491 bytes --]
#autoload
local expl ports
if ! zstyle -a ":completion:${curcontext}:" ports ports; then
(( $+_cache_ports )) ||
: ${(A)_cache_ports:=${${${(u)${${(M)${${(f)"$(</etc/services)"}:#\#*}#*/(tcp|udp)}%%/(tcp|udp)*}}/(#b)(*)[[:space:]]##([[:digit:]]#)/$match[2]:$match[1]}/[[:space:]]*}}
# : ${(A)_cache_ports:=${${(M)${${(f)"$(</etc/services)"}:#\#*}#*/tcp}%%[ ]*}}
ports=( "$_cache_ports[@]" )
fi
#_wanted ports expl port compadd -a "$@" - ports
_describe -t ports "ports" ports
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2009-11-12 11:33 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-11-12 11:03 bad behaviour for _ports ? Baptiste Daroussin
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).