#compdef conch
_arguments -s -A "-*" \
'1:host | user@host:{_ssh;if compset -P "*@"; then _wanted hosts expl "remote host name" _ssh_hosts && ret=0 elif compset -S "@*"; then _wanted users expl "login name" _ssh_users -S "" && ret=0 else if (( $+opt_args[-l] )); then tmp=() else tmp=( "users:login name:_ssh_users -qS@" ) fi; _alternative "hosts:remote host name:_ssh_hosts" "$tmp[@]" && ret=0 fi}' \
'*:command: ' \
'(--noagent -a --agent)-A[Enable authentication agent forwarding]' \
'(--noagent -a -A)--agent[Enable authentication agent forwarding]' \
"(--ciphers)-c[Select encryption algorithms]:ciphers:_values -s , 'ciphers to choose from' idea-ctr blowfish-ctr none arcfour aes256-ctr cast128-ctr idea-cbc blowfish-cbc 3des-cbc aes256-cbc 3des-ctr cast128-cbc aes128-ctr aes192-cbc aes192-ctr aes128-cbc" \
"(-c)--ciphers=[Select encryption algorithms]:ciphers:_values -s , 'ciphers to choose from' idea-ctr blowfish-ctr none arcfour aes256-ctr cast128-ctr idea-cbc blowfish-cbc 3des-cbc aes256-cbc 3des-ctr cast128-cbc aes128-ctr aes192-cbc aes192-ctr aes128-cbc" \
'(--compress)-C[Enable compression.]' \
'(-C)--compress[Enable compression.]' \
"(--connection-usage)-K[Connection types to use]:connection-usage:_values -s , 'connection types to choose from' unix direct" \
"(-K)--connection-usage=[Connection types to use]:connection-usage:_values -s , 'connection types to choose from' unix direct" \
"(--escape)-e[Set escape character; \`\`none'' = disable]:escape:_files" \
"(-e)--escape=[Set escape character; \`\`none'' = disable]:escape:_files" \
'(--fork)-f[Fork to background after authentication.]' \
'(-f)--fork[Fork to background after authentication.]' \
'--help[Display this help and exit.]' \
"--host-key-algorithms=[Select host key algorithms]:host-key-algorithms:_values -s , 'host key algorithms to choose from' ssh-rsa ssh-dss" \
'(--identity)-i[Identity for public-key authentication]:identity:_files' \
'(-i)--identity=[Identity for public-key authentication]:identity:_files' \
'--known-hosts=[File to check for host keys]:known-hosts:_files' \
'(--localforward)-L[listen-port:host:port   Forward local port to remote address]:listen-port:host:port:_files' \
'(-L)--localforward=[listen-port:host:port   Forward local port to remote address]:listen-port:host:port:_files' \
'(--log)-v[Enable logging (defaults to stderr)]' \
'(-v)--log[Enable logging (defaults to stderr)]' \
'--logfile=[File to log to, or - for stdout]:logfile:_files' \
"(--macs)-m[Specify MAC algorithms]:macs:_values -s , 'macs to choose from' hmac-sha1 none hmac-md5" \
"(-m)--macs=[Specify MAC algorithms]:macs:_values -s , 'macs to choose from' hmac-sha1 none hmac-md5" \
'(--agent -A --noagent)-a[Disable authentication agent forwarding (default)]' \
'(--agent -A -a)--noagent[Disable authentication agent forwarding (default)]' \
'(--nocache)-I[Do not allow connection sharing over this connection.]' \
'(-I)--nocache[Do not allow connection sharing over this connection.]' \
'(--noshell)-N[Do not execute a shell or command.]' \
'(-N)--noshell[Do not execute a shell or command.]' \
'(--notty)-T[Do not allocate a tty.]' \
'(-T)--notty[Do not allocate a tty.]' \
'(--nox11)-x[Disable X11 connection forwarding (default)]' \
'(-x)--nox11[Disable X11 connection forwarding (default)]' \
'(--null)-n[Redirect input from /dev/null.]' \
'(-n)--null[Redirect input from /dev/null.]' \
'(--option)-o[Ignored OpenSSH options]:option:_files' \
'(-o)--option=[Ignored OpenSSH options]:option:_files' \
'(--port)-p[Connect to this port.  Server must be on the same port.]:port:_files' \
'(-p)--port=[Connect to this port.  Server must be on the same port.]:port:_files' \
'(--reconnect)-r[Reconnect to the server if the connection is lost.]' \
'(-r)--reconnect[Reconnect to the server if the connection is lost.]' \
'(--remoteforward)-R[listen-port:host:port   Forward remote port to local address]:listen-port:host:port:_files' \
'(-R)--remoteforward=[listen-port:host:port   Forward remote port to local address]:listen-port:host:port:_files' \
'(--subsystem)-s[Invoke command (mandatory) as SSH2 subsystem.]' \
'(-s)--subsystem[Invoke command (mandatory) as SSH2 subsystem.]' \
'(--tty)-t[Tty; allocate a tty even if command is given.]' \
'(-t)--tty[Tty; allocate a tty even if command is given.]' \
'(--user)-l[Log in using this user name.]:user:_users' \
'(-l)--user=[Log in using this user name.]:user:_users' \
'--user-authentications=[Types of user authentications to use.]:user-authentications:_files' \
'(--version)-V[Display version number only.]' \
'(-V)--version[Display version number only.]' \
&& return 0
