1
0
mirror of https://github.com/dcarrillo/prezto.git synced 2024-06-30 12:30:27 +00:00

utility: fix completion for rsync and scp

This commit is contained in:
Kaleb Elwert 2017-07-14 13:28:29 -07:00
parent c1a8fc0469
commit 90071d3ad0

View File

@ -41,8 +41,8 @@ alias ftp='noglob ftp'
alias history='noglob history' alias history='noglob history'
alias locate='noglob locate' alias locate='noglob locate'
alias rake='noglob rake' alias rake='noglob rake'
alias rsync='noglob rsync_scp_wrap rsync' alias rsync='noglob rsync_wrap'
alias scp='noglob rsync_scp_wrap scp' alias scp='noglob scp_wrap'
# This function wraps rsync and scp so that remote paths are not globbed # This function wraps rsync and scp so that remote paths are not globbed
# but local paths are globbed. This is because the programs have their own # but local paths are globbed. This is because the programs have their own
# globbing for remote paths. The wrap function globs args starting in / and ./ # globbing for remote paths. The wrap function globs args starting in / and ./
@ -61,6 +61,15 @@ function rsync_scp_wrap {
esac; done esac; done
command $cmd "${(@)args}" command $cmd "${(@)args}"
} }
function rsync_wrap {
rsync_scp_wrap "rsync" "$@"
}
function scp_wrap {
rsync_scp_wrap "scp" "$@"
}
compdef _rsync rsync_wrap
compdef _scp scp_wrap
alias sftp='noglob sftp' alias sftp='noglob sftp'
# Define general aliases. # Define general aliases.