From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-workers@sunsite.auc.dk
Subject: Re: Questions/comments on completion code that arise from PWS's zsh guide
Date: Mon, 28 Feb 2000 10:36:43 +0100 (MET) [thread overview]
Message-ID: <200002280936.KAA02281@beta.informatik.hu-berlin.de> (raw)
In-Reply-To: "Bart Schaefer"'s message of Fri, 25 Feb 2000 16:55:36 +0000
Bart Schaefer wrote:
> On Feb 25, 2:16pm, Sven Wischnowsky wrote:
> } Subject: Re: Questions/comments on completion code that arise from PWS's z
> }
> } Question: should we change the hosts-ports-users style to
> } `users-hosts-ports' and allow `user@host:port' (although that would
> } then also allow `user@host@port' because the separator is used for all
> } parts)?
>
> I'd be in favor of that.
Good.
Maybe we should change _telnet, it's really broken for me because it
doesn't even guess that my telnet supports -l. I think we should
change the default specs to _arguments. Or are there any telnets
without a -l option? Tanaka?
Bye
Sven
diff -ru ../z.old/Completion/Base/_combination Completion/Base/_combination
--- ../z.old/Completion/Base/_combination Mon Feb 28 10:02:50 2000
+++ Completion/Base/_combination Mon Feb 28 10:17:24 2000
@@ -8,19 +8,19 @@
#
# Example: telnet
#
-# Assume an user sets the style `hosts-ports-users' as for the my-accounts
+# Assume an user sets the style `users-hosts-ports' as for the my-accounts
# tag:
#
-# zstyle ':completion:*:*:telnet:*:my-accounts' hosts-ports-users \
-# host0:: host1::user1 host2::user2
-# mail-server:{smtp,pop3}:
-# news-server:nntp:
-# proxy-server:8000:
+# zstyle ':completion:*:*:telnet:*:my-accounts' users-hosts-ports \
+# @host0: user1@host1: user2@host2:
+# @mail-server:{smtp,pop3}
+# @news-server:nntp
+# @proxy-server:8000
#
#
# `_telnet' completes hosts as:
#
-# _combination my-accounts hosts-ports-users \
+# _combination my-accounts users-hosts-ports \
# ${opt_args[-l]:+users=${opt_args[-l]:q}} \
# hosts "$expl[@]"
#
@@ -30,7 +30,7 @@
#
# `_telnet' completes ports as:
#
-# _combination my-accounts hosts-ports-users \
+# _combination my-accounts users-hosts-ports \
# ${opt_args[-l]:+users=${opt_args[-l]:q}} \
# hosts="${line[2]:q}" \
# ports "$expl[@]"
@@ -41,7 +41,7 @@
#
# `_telnet' completes users for an argument of option `-l' as:
#
-# _combination my-accounts hosts-ports-users \
+# _combination my-accounts users-hosts-ports \
# ${line[2]:+hosts="${line[2]:q}"} \
# ${line[3]:+ports="${line[3]:q}"} \
# users "$expl[@]"
diff -ru ../z.old/Completion/Builtins/_zstyle Completion/Builtins/_zstyle
--- ../z.old/Completion/Builtins/_zstyle Mon Feb 28 10:02:53 2000
+++ Completion/Builtins/_zstyle Mon Feb 28 10:33:46 2000
@@ -30,7 +30,7 @@
hidden c:bool
hosts c:_hosts
hosts-ports c:host-port
- hosts-ports-users c:host-port-user
+ users-hosts-ports c:user-host-port
ignore-parents c:ignorepar
ignored-patterns c:
insert-unambiguous c:bool
@@ -155,15 +155,24 @@
_expand _list _menu _oldlist
;;
- host-port*)
+ user-host-port)
+ if [[ $PREFIX != *[@:]* ]]; then
+ _users -S @
+ elif [[ $PREFIX = *[@:]*[[@:]* ]]; then
+ compset -P 2 '*[:@]'
+ _ports
+ else
+ compset -P 1 '*[:@]'
+ _hosts -S :
+ fi
+ ;;
+
+ host-port)
if [[ $PREFIX != *:* ]]; then
_hosts -S :
- elif [[ $ostate != *user || $PREFIX != *:*:* ]]; then
+ else
compset -P 1 '*:'
_ports
- else
- compset -P 2 '*:'
- _users
fi
;;
@@ -197,11 +206,11 @@
;;
user-host)
- if [[ $PREFIX = *:* ]]; then
- compset -P '*:'
+ if [[ $PREFIX = *[@:]* ]]; then
+ compset -P '*[@:]'
_hosts
else
- _users
+ _users -S @
fi
;;
diff -ru ../z.old/Completion/User/_telnet Completion/User/_telnet
--- ../z.old/Completion/User/_telnet Mon Feb 28 10:03:10 2000
+++ Completion/User/_telnet Mon Feb 28 10:32:13 2000
@@ -47,14 +47,14 @@
case "$state" in
hosts)
_wanted hosts expl host &&
- _combination '' hosts-ports-users \
+ _combination -s '[@:]' '' users-hosts-ports \
${opt_args[-l]:+users=${opt_args[-l]:q}} \
hosts "$expl[@]"
;;
ports)
_wanted ports expl port &&
- _combination '' hosts-ports-users \
+ _combination -s '[@:]' '' users-hosts-ports \
${opt_args[-l]:+users=${opt_args[-l]:q}} \
hosts="${line[1]:q}" \
ports "$expl[@]"
@@ -62,7 +62,7 @@
users)
_wanted users expl user &&
- _combination '' hosts-ports-users \
+ _combination -s '[@:]' '' users-hosts-ports \
${line[2]:+hosts="${line[2]:q}"} \
${line[3]:+ports="${line[3]:q}"} \
users "$expl[@]"
diff -ru ../z.old/Doc/Zsh/compsys.yo Doc/Zsh/compsys.yo
--- ../z.old/Doc/Zsh/compsys.yo Mon Feb 28 09:08:57 2000
+++ Doc/Zsh/compsys.yo Mon Feb 28 10:24:16 2000
@@ -935,10 +935,6 @@
example, the hostname is already typed, only those ports will be
completed for which pairs with the hostname from the line exist.
)
-item(tt(hosts-ports-users))(
-Like tt(hosts-ports) but used for commands like tt(telnet) and
-containing strings of the form `var(host)tt(:)var(port)tt(:)var(user)'.
-)
item(tt(ignore-parents))(
When completing files it is possible to make names of directories
already mentioned on the line or the current working directory be
@@ -1468,6 +1464,10 @@
commands such as tt(talk) and tt(finger) and should contain other
people's accounts. Finally, this may also be used by some commands with
the tt(accounts) tag.
+)
+item(tt(users-hosts-ports))(
+Like tt(users-hosts) but used for commands like tt(telnet) and
+containing strings of the form `var(user)tt(@)var(host)tt(:)var(port)'.
)
item(tt(verbose))(
This is used in several contexts to decide if only a simple or a
--
Sven Wischnowsky wischnow@informatik.hu-berlin.de
next reply other threads:[~2000-02-28 9:36 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-02-28 9:36 Sven Wischnowsky [this message]
2000-02-28 9:47 ` Andrej Borsenkow
2000-02-28 10:16 ` Tanaka Akira
-- strict thread matches above, loose matches on Subject: below --
2000-02-25 13:16 Sven Wischnowsky
2000-02-25 16:55 ` Bart Schaefer
2000-02-24 8:51 Sven Wischnowsky
2000-02-24 17:45 ` Bart Schaefer
2000-02-23 16:17 Bart Schaefer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200002280936.KAA02281@beta.informatik.hu-berlin.de \
--to=wischnow@informatik.hu-berlin.de \
--cc=zsh-workers@sunsite.auc.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).