about summary refs log tree commit diff
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>2000-01-30 04:13:27 +0000
committerTanaka Akira <akr@users.sourceforge.net>2000-01-30 04:13:27 +0000
commita6fa59781ed759988245b5871f48d57fa92c309c (patch)
tree1c98910eedf0ffe1f5692af1732e2c1a2ad29b9c
parentd498ce092e4fd4ea6992925f11e7fc1a2bbff4c5 (diff)
downloadzsh-a6fa59781ed759988245b5871f48d57fa92c309c.tar.gz
zsh-a6fa59781ed759988245b5871f48d57fa92c309c.tar.xz
zsh-a6fa59781ed759988245b5871f48d57fa92c309c.zip
zsh-workers/9475
-rw-r--r--Completion/User/_telnet58
1 files changed, 27 insertions, 31 deletions
diff --git a/Completion/User/_telnet b/Completion/User/_telnet
index 383d43ac7..fd7edd569 100644
--- a/Completion/User/_telnet
+++ b/Completion/User/_telnet
@@ -9,38 +9,34 @@ local curcontext="$curcontext" state line expl
 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 \