Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: The group-order and tag-order styles
- X-seq: zsh-workers 14901
- From: Sven Wischnowsky <wischnow@xxxxxxxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxx
- Subject: Re: The group-order and tag-order styles
- Date: Wed, 13 Jun 2001 14:53:30 +0200 (MET DST)
- In-reply-to: <1010613114538.ZM26897@xxxxxxxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
Bart Schaefer wrote:
> ...
>
> With just the last of these styles, completion after `ssh' lists two groups:
> hosts first, then users. What I want to see is three groups: hosts by
> domain name, then users, then hosts by IP address. Adding the other styles
> successfully splits the result into three groups, but the users are always
> listed first. Also, the explanation strings (`domains' and `IP addresses')
> from the group-order style are never shown in the listing.
>
> What am I missing?
The group-order style takes just group names as values, no fancy
aliasing or description stuff, that comes with the tag-order style.
Like so:
zstyle ':completion:*:ssh:*' tag-order \
'hosts:-domain:domains hosts:-ipaddr:IP\ addresses *'
zstyle ':completion:*:ssh:*' group-order \
hosts-domain users hosts-ipaddr
zstyle ':completion:*:ssh:*:hosts-domain' ignored-patterns '<->.<->.<->.<->'
zstyle ':completion:*:ssh:*:hosts-ipaddr' ignored-patterns '^<->.<->.<->.<->'
zstyle -e ':completion:*:ssh:*' hosts 'reply=(
${=${${(f)"$(cat {/etc/ssh_,~/.ssh/known_}hosts(|2)(N) \
/dev/null)"}%%[# ]*}//,/ }
${=${(f)"$(cat /etc/hosts(|)(N) <<(ypcat hosts 2>/dev/null))"}%%\#*}
)'
Which gives me what you want.
Bye
Sven
--
Sven Wischnowsky wischnow@xxxxxxxxxxxxxxxxxxxxxxx
Messages sorted by:
Reverse Date,
Date,
Thread,
Author