2009-12-24 16:18:27 +02:00
|
|
|
# sshfs(1) completion
|
|
|
|
|
2011-04-05 00:35:51 +03:00
|
|
|
have sshfs || return
|
|
|
|
|
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-04-24 18:55:04 +03:00
|
|
|
if [[ "$cur" == *:* ]] && declare -F _scp_remote_files &>/dev/null ; then
|
2009-12-26 16:20:14 +02:00
|
|
|
_scp_remote_files -d
|
|
|
|
# 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
|
|
|
|
|
|
|
|
[[ "$cur" == */* ]] || _known_hosts_real -c -a "$cur"
|
|
|
|
|
2011-04-24 18:55:04 +03:00
|
|
|
declare -F _scp_local_files &>/dev/null && _scp_local_files -d
|
2009-12-24 16:18:27 +02:00
|
|
|
|
|
|
|
return 0
|
|
|
|
} &&
|
|
|
|
complete -F _sshfs -o nospace sshfs
|
|
|
|
|
|
|
|
# Local variables:
|
|
|
|
# mode: shell-script
|
|
|
|
# sh-basic-offset: 4
|
|
|
|
# sh-indent-comment: t
|
|
|
|
# indent-tabs-mode: nil
|
|
|
|
# End:
|
|
|
|
# ex: ts=4 sw=4 et filetype=sh
|