Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
bad behaviour for _ports ?
- X-seq: zsh-workers 27393
- From: Baptiste Daroussin <baptiste.daroussin@xxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: bad behaviour for _ports ?
- Date: Thu, 12 Nov 2009 12:03:19 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:received:date:from:to:subject :message-id:mime-version:content-type:content-disposition:user-agent; bh=yrgfLzHZ2Qxow68mmimeAW45EaQ4isfZnu0ckwpJQBA=; b=fy5LLHSlosI2CC18T8wotqYx2E3kRRzRA9ynvYcG1BtIffU7+FZxyIcPsrCMpknjDe 5ydn9WtgnI7fu02Jjux6Ad+oxxy2UH5pLsCeuCzuO7cfn7BQwUgQOPRZNhemoa8xrus5 rHsLFwG6oD3KMpIyxIU53kTHhDS2Z76p8CUIc=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:subject:message-id:mime-version:content-type :content-disposition:user-agent; b=rWLDutyBrdp+Yo6iGXLkLy9jYCwKIHYyPupgokC2EOy4/3e4sQyJM/fNjrfnai/kWd aH0Rs/Bcl9HCl2pDkrhqvF72y9bGLKVcvbnqqAvli+w0gViqJiJGhtGXbDD7yqMMCsIx GKiOCjpqQSE15ra/ebVw3E/jAWwjz6kyF4058=
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
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
#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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author