zsh-workers
 help / color / mirror / code / Atom feed
From: Tanaka Akira <akr@jaist.ac.jp>
To: zsh-workers@sunsite.auc.dk
Subject: Re: PATCH: was: oops, a set -x
Date: 24 Nov 1999 00:40:23 +0900	[thread overview]
Message-ID: <rsqn1s543o8.fsf@crane.jaist.ac.jp> (raw)
In-Reply-To: Sven Wischnowsky's message of "Tue, 23 Nov 1999 15:12:12 +0100 (MET)"

In article <199911231412.PAA09062@beta.informatik.hu-berlin.de>,
  Sven Wischnowsky <wischnow@informatik.hu-berlin.de> writes:

> However, I have *not* change _telnet because, as I said, I don't have
> a version with these options. Tanaka, could you...? If I'm not
> completely mistaken it should just make it much simpler.

In reality, I don't have such telnet too.  So, I test _telnet with
following function.  I think _arguments works well.

telnet () {
  print -r - \
'Usage: telnet [-8] [-E] [-K] [-L] [-N] [-S tos] [-X atype] [-a] [-c] [-d]
	[-e char] [-k realm] [-l user] [-f/-F] [-n tracefile] [-noasynch] [-noasynctty]
	[-noasyncnet] [-r] [-s src_addr] [-t transcom] [host-name [port]]' >&2
}

Index: Completion/User/_telnet
===================================================================
RCS file: /projects/zsh/zsh/Completion/User/_telnet,v
retrieving revision 1.1.1.11
diff -u -r1.1.1.11 _telnet
--- Completion/User/_telnet	1999/11/22 13:31:19	1.1.1.11
+++ Completion/User/_telnet	1999/11/23 15:28:53
@@ -8,7 +8,7 @@
 local curcontext="$curcontext" state line expl
 typeset -A opt_args
 
-if (( ! $+_telnet_short )); then
+if (( ! $+_telnet_args )); then
   local k help="$(telnet -\? < /dev/null 2>&1)"
   local -A optionmap
   optionmap=( "[-8]" '-8[allow 8-Bit data]' \
@@ -30,34 +30,21 @@
               "[-r]" '-r[rlogin like user interface]' \
               "[-s src_addr]" '-s+[set source IP address]:src_addr:' \
               "[-x]" '-x' \
-              "[-t transcom]" '-t+:transcom:' )
-
-  _telnet_short=()
-  for k in ${(k)optionmap}
-  do
-    [[ "$help" = *"$k"* ]] &&
-      _telnet_short=( "$_telnet_short[@]" "$optionmap[$k]" )
-  done
-
-  # _arguments cannot handle following three options.
-  optionmap=( "[-noasynch]" '-noasynch' \
+              "[-t transcom]" '-t+:transcom:' \
+              "[-noasynch]" '-noasynch' \
               "[-noasyncnet]" '-noasyncnet' \
               "[-noasynctty]" '-noasynctty' )
 
-  _telnet_long=()
+  _telnet_args=()
   for k in ${(k)optionmap}
   do
     [[ "$help" = *"$k"* ]] &&
-      _telnet_long=( "$_telnet_long[@]" "$optionmap[$k]" )
+      _telnet_args=( "$_telnet_args[@]" "$optionmap[$k]" )
   done
 fi
 
-(( $#_telnet_long )) && _wanted options expl option &&
-   { ! _style options prefix-needed || [[ "$PREFIX" = [-+]* ]] } &&
-    _describe -o option _telnet_long "$expl[@]"
-
 _arguments -C -s \
-  "$_telnet_short[@]" \
+  "$_telnet_args[@]" \
   ':host:->hosts' \
   ':port:->ports'
 
-- 
Tanaka Akira


      reply	other threads:[~1999-11-23 15:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-11-23 14:12 Sven Wischnowsky
1999-11-23 15:40 ` Tanaka Akira [this message]

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=rsqn1s543o8.fsf@crane.jaist.ac.jp \
    --to=akr@jaist.ac.jp \
    --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).