zsh/compdef/_sfs

16 lines
318 B
Plaintext
Raw Permalink Normal View History

2018-08-28 18:35:06 +00:00
#compdef sfs
if compset -P 1 '*:'; then
_remote_files -- ssh
elif compset -P 1 '*@'; then
_wanted hosts expl host _ssh_hosts -r: -S:
else
_alternative \
'hosts:remote host name:_ssh_hosts -r: -S:' \
'users:user:_ssh_users -qS@'
fi
_ssh_users () {
_combination -s '[:@]' my-accounts users-hosts users "$@"
}