1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-01-27 02:01:09 +01:00

Initial revision

This commit is contained in:
Tanaka Akira 1999-09-12 00:02:45 +00:00
parent 48306f7ac4
commit 567917651a
3 changed files with 64 additions and 0 deletions

View file

@ -0,0 +1,9 @@
#autoload
# Usage: _hostport host
local host="$1"
shift
compadd "$@" - ${${(M)hosts\:#$host\:*}#*\:}

34
Completion/User/_socket Normal file
View file

@ -0,0 +1,34 @@
#compdef socket
local state line expl
typeset -A options
_arguments -s \
-{b,c,f,q,r,v,w} \
-{s,l} \
'-p:command:->command' \
':arg1:->arg1' \
':arg2:->arg2'
case "$state" in
command)
compset -q
_normal
;;
arg1)
if (( $+options[-s] )); then
_message 'port'
else
_description expl 'host'
_hosts "$expl[@]"
fi
;;
arg2)
if (( ! $+options[-s] )); then
_description expl 'port'
_hostports $line[2] "$expl[@]"
fi
;;
esac

21
Completion/User/_telnet Normal file
View file

@ -0,0 +1,21 @@
#compdef telnet
_arguments -s \
-{F,f,x} \
'-8[allow 8-Bit data]' \
'-E[disable an escape character]' \
'-K[no automatic login]' \
'-L[allow 8-Bit data on output]' \
'-S+:IP type-of-service:' \
'-X+:authentication type to disable:' \
'-a[attempt automatic login]' \
'-c[disable .telnetrc]' \
'-d[debug mode]' \
'-e+[specify escape character]:escape character:' \
'-k+:realm:' \
'-l+[specify user]:user:' \
'-n+[specify tracefile]:tracefile:_files' \
'-r[rlogin like user interface]' \
':host:_hosts' \
':port:{ _hostports $line[2] "$expl[@]" }'