mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-09-10 12:40:58 +02:00
zsh-users/2930
This commit is contained in:
parent
144a234d65
commit
e0c99aa850
1 changed files with 7 additions and 1 deletions
|
@ -1,5 +1,11 @@
|
||||||
#compdef ssh slogin scp ssh-add ssh-agent ssh-keygen
|
#compdef ssh slogin scp ssh-add ssh-agent ssh-keygen
|
||||||
|
|
||||||
|
_remote_files () {
|
||||||
|
# This is extremely simple-minded; could parse "ls -F" output to do
|
||||||
|
# colorings and LIST_TYPES and so on, but I'm just not that ambitious.
|
||||||
|
compadd $(ssh ${words[CURRENT]%:*} echo ${words[CURRENT]#*:}\*)
|
||||||
|
}
|
||||||
|
|
||||||
_ssh () {
|
_ssh () {
|
||||||
local curcontext="$curcontext" state lstate line ret=1 expl args tmp
|
local curcontext="$curcontext" state lstate line ret=1 expl args tmp
|
||||||
typeset -A opt_args
|
typeset -A opt_args
|
||||||
|
@ -172,7 +178,7 @@ _ssh () {
|
||||||
return
|
return
|
||||||
elif [[ -n "$state" ]]; then
|
elif [[ -n "$state" ]]; then
|
||||||
if compset -P '*:'; then
|
if compset -P '*:'; then
|
||||||
_files && ret=0
|
_remote_files && ret=0
|
||||||
elif compset -P '*@'; then
|
elif compset -P '*@'; then
|
||||||
_wanted hosts expl host && _ssh_hosts -S: "$expl[@]" && ret=0
|
_wanted hosts expl host && _ssh_hosts -S: "$expl[@]" && ret=0
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue