mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-10-08 21:51:15 +02:00
zsh-workers/7739
This commit is contained in:
parent
8e5dd8675f
commit
c9cc736127
1 changed files with 47 additions and 15 deletions
|
@ -1,19 +1,51 @@
|
||||||
#compdef rlogin rsh
|
#compdef rlogin rsh remsh rcp
|
||||||
|
|
||||||
local expl
|
case "$words[1]" in
|
||||||
|
rlogin)
|
||||||
|
_arguments -s \
|
||||||
|
'-8[allow 8-Bit data]' \
|
||||||
|
'-e-[specify escape character]:escape character:' \
|
||||||
|
'-l[specify login user name]:login as:_users' \
|
||||||
|
':remote host name:_hosts'
|
||||||
|
;;
|
||||||
|
rsh|remsh)
|
||||||
|
local state line ret=1
|
||||||
|
typeset -A options
|
||||||
|
|
||||||
_description expl user
|
_arguments -s \
|
||||||
|
'-n[ignore stdin]' \
|
||||||
|
'-l[specify login user name]:login as:_users' \
|
||||||
|
':remote host name:_hosts' \
|
||||||
|
':command: _command_names -e' \
|
||||||
|
'*::command:->command' && ret=0
|
||||||
|
|
||||||
if [[ CURRENT -eq 2 ]];
|
if [[ -n "$state" ]]; then
|
||||||
if compset -P 1 '*@'; then
|
shift 1 words
|
||||||
_hosts
|
(( CURRENT-- ))
|
||||||
else
|
_normal && ret=0
|
||||||
local nm=${compstate[nmatches]}
|
|
||||||
_hosts
|
|
||||||
[[ nm -eq compstate[nmatches] ]] && compgen "$expl[@]" -S @ -u
|
|
||||||
fi
|
fi
|
||||||
elif [[ CURRENT -eq 3 ]]; then
|
return ret
|
||||||
compadd - -l
|
;;
|
||||||
else
|
rcp)
|
||||||
_users -S @
|
local state line ret=1
|
||||||
fi
|
typeset -A options
|
||||||
|
|
||||||
|
_arguments -s \
|
||||||
|
'-p[preserve modification times]' \
|
||||||
|
'-r[recursively copy directories]' \
|
||||||
|
'*:files:->files' && ret=0
|
||||||
|
|
||||||
|
if [[ -n "$state" ]]; then
|
||||||
|
if compset -P '*:'; then
|
||||||
|
_files && ret=0
|
||||||
|
elif compset -P '*@'; then
|
||||||
|
_hosts -S: && ret=0
|
||||||
|
else
|
||||||
|
_files && ret=0
|
||||||
|
_hosts -S: && ret=0
|
||||||
|
_users -S@ && ret=0
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
return ret
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
Loading…
Reference in a new issue