Skip to content

Commit

Permalink
utility: fix completion for rsync and scp
Browse files Browse the repository at this point in the history
  • Loading branch information
belak committed Jul 14, 2017
1 parent c1a8fc0 commit 90071d3
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions modules/utility/init.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ alias ftp='noglob ftp'
alias history='noglob history'
alias locate='noglob locate'
alias rake='noglob rake'
alias rsync='noglob rsync_scp_wrap rsync'
alias scp='noglob rsync_scp_wrap scp'
alias rsync='noglob rsync_wrap'
alias scp='noglob scp_wrap'
# 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
# globbing for remote paths. The wrap function globs args starting in / and ./
Expand All @@ -61,6 +61,15 @@ function rsync_scp_wrap {
esac; done
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'

# Define general aliases.
Expand Down

0 comments on commit 90071d3

Please sign in to comment.