From 90071d3ad062c4969b1d2e8512e9238524b90981 Mon Sep 17 00:00:00 2001 From: Kaleb Elwert Date: Fri, 14 Jul 2017 13:28:29 -0700 Subject: [PATCH] utility: fix completion for rsync and scp --- modules/utility/init.zsh | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/modules/utility/init.zsh b/modules/utility/init.zsh index e9c20b21..a3cb240a 100644 --- a/modules/utility/init.zsh +++ b/modules/utility/init.zsh @@ -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 ./ @@ -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.