From 0c06ea2cb6deea14ce18b2db1b6e726a103fd7be Mon Sep 17 00:00:00 2001 From: rnaimi Date: Tue, 21 Mar 2017 16:45:19 -0700 Subject: [PATCH] deal with single letter options that can be specified multiple times like zz --- rsync.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/rsync.js b/rsync.js index a8a7d73..51f7e2a 100644 --- a/rsync.js +++ b/rsync.js @@ -985,6 +985,11 @@ function buildOption(name, value, escapeArg) { // Detect single option key var single = (name.length === 1) ? true : false; + if (name[0] == '~') { + single = true; + name = name.substring (1); + } + // Decide on prefix and value glue var prefix = (single) ? '-' : '--'; var glue = (single) ? ' ' : '='; @@ -1022,7 +1027,7 @@ function escapeFileArg(filename) { return filename; } // Under Windows rsync (with cygwin) and OpenSSH for Windows - // (http://www.mls-software.com/opensshd.html) are using + // (http://www.mls-software.com/opensshd.html) are using // standard linux directory separator so need to replace it if ('win32' === process.platform) { filename = filename.replace(/\\\\/g,'/').replace(/^["]?[A-Z]\:\//ig,'/');