mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-09-19 15:41:32 +02:00
zsh-workers/8752
This commit is contained in:
parent
de8e061ef3
commit
ae7c7a9433
1 changed files with 6 additions and 19 deletions
|
@ -8,7 +8,7 @@
|
||||||
local curcontext="$curcontext" state line expl
|
local curcontext="$curcontext" state line expl
|
||||||
typeset -A opt_args
|
typeset -A opt_args
|
||||||
|
|
||||||
if (( ! $+_telnet_short )); then
|
if (( ! $+_telnet_args )); then
|
||||||
local k help="$(telnet -\? < /dev/null 2>&1)"
|
local k help="$(telnet -\? < /dev/null 2>&1)"
|
||||||
local -A optionmap
|
local -A optionmap
|
||||||
optionmap=( "[-8]" '-8[allow 8-Bit data]' \
|
optionmap=( "[-8]" '-8[allow 8-Bit data]' \
|
||||||
|
@ -30,34 +30,21 @@ if (( ! $+_telnet_short )); then
|
||||||
"[-r]" '-r[rlogin like user interface]' \
|
"[-r]" '-r[rlogin like user interface]' \
|
||||||
"[-s src_addr]" '-s+[set source IP address]:src_addr:' \
|
"[-s src_addr]" '-s+[set source IP address]:src_addr:' \
|
||||||
"[-x]" '-x' \
|
"[-x]" '-x' \
|
||||||
"[-t transcom]" '-t+:transcom:' )
|
"[-t transcom]" '-t+:transcom:' \
|
||||||
|
"[-noasynch]" '-noasynch' \
|
||||||
_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' \
|
|
||||||
"[-noasyncnet]" '-noasyncnet' \
|
"[-noasyncnet]" '-noasyncnet' \
|
||||||
"[-noasynctty]" '-noasynctty' )
|
"[-noasynctty]" '-noasynctty' )
|
||||||
|
|
||||||
_telnet_long=()
|
_telnet_args=()
|
||||||
for k in ${(k)optionmap}
|
for k in ${(k)optionmap}
|
||||||
do
|
do
|
||||||
[[ "$help" = *"$k"* ]] &&
|
[[ "$help" = *"$k"* ]] &&
|
||||||
_telnet_long=( "$_telnet_long[@]" "$optionmap[$k]" )
|
_telnet_args=( "$_telnet_args[@]" "$optionmap[$k]" )
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
(( $#_telnet_long )) && _wanted options expl option &&
|
|
||||||
{ ! _style options prefix-needed || [[ "$PREFIX" = [-+]* ]] } &&
|
|
||||||
_describe -o option _telnet_long "$expl[@]"
|
|
||||||
|
|
||||||
_arguments -C -s \
|
_arguments -C -s \
|
||||||
"$_telnet_short[@]" \
|
"$_telnet_args[@]" \
|
||||||
':host:->hosts' \
|
':host:->hosts' \
|
||||||
':port:->ports'
|
':port:->ports'
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue