about summary refs log tree commit diff
path: root/Completion/User/_telnet
blob: 594dcf2e53ce9b5fd8e5216191c41008b6364fac (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#compdef telnet

# Parameter used:
#
#  telnet_ports
#    The associative array that maps a host name to a space-separated list of
#    ports.

_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:{ compadd "$expl[@]" - ${(k)telnet_ports} || _hosts "$expl[@]" }' \
  ':port:{ if (( $+telnet_ports )); then compadd "$expl[@]" - ${=telnet_ports[$line[2]]}; else _message "port"; fi }'