From: Tanaka Akira <akr@jaist.ac.jp>
To: zsh-workers@sunsite.auc.dk
Subject: PATCH: replace a for-loop by a K flag in _telnet
Date: 30 Jan 2000 13:12:56 +0900 [thread overview]
Message-ID: <rsqoga4urhz.fsf@crane.jaist.ac.jp> (raw)
This replaces a for-loop by a K flag in _telnet.
Index: Completion/User/_telnet
===================================================================
RCS file: /projects/zsh/zsh/Completion/User/_telnet,v
retrieving revision 1.1.1.12
diff -u -r1.1.1.12 _telnet
--- Completion/User/_telnet 1999/11/23 15:44:13 1.1.1.12
+++ Completion/User/_telnet 2000/01/30 03:46:33
@@ -9,38 +9,34 @@
typeset -A opt_args
if (( ! $+_telnet_args )); then
- local k help="$(telnet -\? < /dev/null 2>&1)"
+ local help="$(telnet -\? < /dev/null 2>&1)"
local -A optionmap
- optionmap=( "[-8]" '-8[allow 8-Bit data]' \
- "[-E]" '-E[disable an escape character]' \
- "[-K]" '-K[no automatic login]' \
- "[-L]" '-L[allow 8-Bit data on output]' \
- "[-N]" '-N[supress reverse lookup]' \
- "[-S tos]" '-S+:IP type-of-service:' \
- "[-X atype]" '-X+:authentication type to disable:' \
- "[-a]" '-a[attempt automatic login]' \
- "[-c]" '-c[disable .telnetrc]' \
- "[-d]" '-d[debug mode]' \
- "[-e char]" '-e+[specify escape character]:escape character:' \
- "[-f/" '-f' \
- "/-F]" '-F' \
- "[-k realm]" '-k+:realm:' \
- "[-l user]" '-l+[specify user]:user:->users' \
- "[-n tracefile]" '-n+[specify tracefile]:tracefile:_files' \
- "[-r]" '-r[rlogin like user interface]' \
- "[-s src_addr]" '-s+[set source IP address]:src_addr:' \
- "[-x]" '-x' \
- "[-t transcom]" '-t+:transcom:' \
- "[-noasynch]" '-noasynch' \
- "[-noasyncnet]" '-noasyncnet' \
- "[-noasynctty]" '-noasynctty' )
-
- _telnet_args=()
- for k in ${(k)optionmap}
- do
- [[ "$help" = *"$k"* ]] &&
- _telnet_args=( "$_telnet_args[@]" "$optionmap[$k]" )
- done
+ optionmap=(
+ '*\[-8\]*' '-8[allow 8-Bit data]'
+ '*\[-E\]*' '-E[disable an escape character]'
+ '*\[-K\]*' '-K[no automatic login]'
+ '*\[-L\]*' '-L[allow 8-Bit data on output]'
+ '*\[-N\]*' '-N[supress reverse lookup]'
+ '*\[-S tos\]*' '-S+:IP type-of-service:'
+ '*\[-X atype\]*' '-X+:authentication type to disable:'
+ '*\[-a\]*' '-a[attempt automatic login]'
+ '*\[-c\]*' '-c[disable .telnetrc]'
+ '*\[-d\]*' '-d[debug mode]'
+ '*\[-e char\]*' '-e+[specify escape character]:escape character:'
+ '*\[-f/*' '-f'
+ '*/-F\]*' '-F'
+ '*\[-k realm\]*' '-k+:realm:'
+ '*\[-l user\]*' '-l+[specify user]:user:->users'
+ '*\[-n tracefile\]*' '-n+[specify tracefile]:tracefile:_files'
+ '*\[-r\]*' '-r[rlogin like user interface]'
+ '*\[-s src_addr\]*' '-s+[set source IP address]:src_addr:'
+ '*\[-x\]*' '-x'
+ '*\[-t transcom\]*' '-t+:transcom:'
+ '*\[-noasynch\]*' '-noasynch'
+ '*\[-noasyncnet\]*' '-noasyncnet'
+ '*\[-noasynctty\]*' '-noasynctty'
+ )
+ _telnet_args=($optionmap[(K)"$help"])
fi
_arguments -C -s \
--
Tanaka Akira
reply other threads:[~2000-01-30 4:13 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=rsqoga4urhz.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).