Skip to content
This repository was archived by the owner on Jul 11, 2023. It is now read-only.

deal with single letter options that can be specified multiple times … #55

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion rsync.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) ? ' ' : '=';
Expand Down Expand Up @@ -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,'/');
Expand Down