diff options
author | Eric Cook <illua@users.sourceforge.net> | 2024-08-03 20:07:51 -0400 |
---|---|---|
committer | Eric Cook <illua@users.sourceforge.net> | 2024-08-03 20:07:51 -0400 |
commit | 5cb32ec5ab1eafdad62500e7e6bdada2c3205a59 (patch) | |
tree | a254f3489e9783f46ff20727bf871f74d6e3e99c /Completion/Unix/Command | |
parent | 0bb140f9911851e9712dba311925f9c9ab521fd2 (diff) | |
download | zsh-5cb32ec5ab1eafdad62500e7e6bdada2c3205a59.tar.gz zsh-5cb32ec5ab1eafdad62500e7e6bdada2c3205a59.zip |
52989: _rsync: support rsync 3.2.4+ remote filename handling.
Diffstat (limited to 'Completion/Unix/Command')
-rw-r--r-- | Completion/Unix/Command/_rsync | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/Completion/Unix/Command/_rsync b/Completion/Unix/Command/_rsync index c65266dbd..81d25a3f4 100644 --- a/Completion/Unix/Command/_rsync +++ b/Completion/Unix/Command/_rsync @@ -60,7 +60,14 @@ elif compset -P 1 '*::' || compset -P 1 'rsync://*/'; then elif compset -P 'rsync://'; then _rsync_user_or_host / "$@" elif compset -P 1 '*:'; then - _remote_files -- ssh + if [[ -v opt_args[(i)client---old-args] || $RSYNC_OLD_ARGS = 1 ]]; then + _remote_files -- ssh + else + # the 3.2.4+ way that rsync handles filenames does not protect *, ? and [] + # so those characters still need to be escaped to prevent being treated as + # a pattern in the remote shell. + _remote_files -Q '[][*?]' -- ssh + fi else _rsync_user_or_host : "$@" fi @@ -236,6 +243,7 @@ _rsync() { '*--include=[do not exclude files matching pattern]:pattern' \ '--files-from=[read list of source-file names from specified file]:file:_files' \ '(-0 --from0)'{-0,--from0}'[all *-from file lists are delimited by nulls]' \ + '--old-args[disable the modern arg-protection idiom]' \ '(-s --secluded-args)'{-s,--secluded-args}'[use the protocol to safely send arguments]' \ "--trust-sender[trust the remote sender's file list]" \ '--copy-as=[specify user & optional group for the copy]:user:_rsync_users_groups' \ |