2011-11-01 22:14:45 +02:00
|
|
|
# sshfs(1) completion -*- shell-script -*-
|
2009-12-24 16:18:27 +02:00
|
|
|
|
|
|
|
_sshfs()
|
|
|
|
{
|
2011-04-21 11:04:51 +03:00
|
|
|
local cur prev words cword
|
|
|
|
_init_completion -n : || return
|
2009-12-24 16:18:27 +02:00
|
|
|
|
2011-04-21 11:04:51 +03:00
|
|
|
local userhost path
|
2009-12-24 16:18:27 +02:00
|
|
|
|
|
|
|
_expand || return 0
|
|
|
|
|
2011-10-13 21:15:05 +03:00
|
|
|
if [[ "$cur" == *:* ]]; then
|
|
|
|
_xfunc ssh _scp_remote_files -d
|
2009-12-26 16:20:14 +02:00
|
|
|
# unlike scp and rsync, sshfs works with 1 backslash instead of 3
|
|
|
|
COMPREPLY=( "${COMPREPLY[@]//\\\\\\/\\}" )
|
2009-12-24 16:18:27 +02:00
|
|
|
return 0
|
|
|
|
fi
|
|
|
|
|
2011-04-24 19:35:42 +03:00
|
|
|
[[ "$cur" == @(*/|[.~])* ]] || _known_hosts_real -c -a "$cur"
|
2009-12-24 16:18:27 +02:00
|
|
|
|
2011-10-13 21:15:05 +03:00
|
|
|
_xfunc ssh _scp_local_files -d
|
2009-12-24 16:18:27 +02:00
|
|
|
|
|
|
|
return 0
|
|
|
|
} &&
|
|
|
|
complete -F _sshfs -o nospace sshfs
|
|
|
|
|
|
|
|
# ex: ts=4 sw=4 et filetype=sh
|