feat: add secluded args compatibility option
CI / lint (pull_request) Successful in 11s
CI / sanitizers (undefined) (pull_request) Successful in 37s
CI / sanitizers (address) (pull_request) Successful in 37s
CI / fuzz-build (pull_request) Successful in 14s
CI / coverage (pull_request) Successful in 31s
CI / build-and-test (pull_request) Successful in 1m15s
CI / valgrind (pull_request) Successful in 33s
CI / lint (pull_request) Successful in 11s
CI / sanitizers (undefined) (pull_request) Successful in 37s
CI / sanitizers (address) (pull_request) Successful in 37s
CI / fuzz-build (pull_request) Successful in 14s
CI / coverage (pull_request) Successful in 31s
CI / build-and-test (pull_request) Successful in 1m15s
CI / valgrind (pull_request) Successful in 33s
This commit is contained in:
@@ -89,6 +89,7 @@ partial, alternate, and planned behavior.
|
||||
| `-a, --archive` | Archive mode: enables `-c -m -M` (no `-s`) |
|
||||
| `-m` | Multithreading mode |
|
||||
| `-s` | Chunk serialization (batch all files per chunk) |
|
||||
| `--secluded-args` | Rsync-compatible long form. SSH already sends transfer arguments through FastSync's protocol; `-s` remains chunk serialization. |
|
||||
| `-f, --sendfile` | Sendfile zero-copy. Incompatible with `-c` / `-s`. TCP only. |
|
||||
| `-M, --preserve` | Preserve supported file metadata (mode and mtime; ownership and atime are unsupported) |
|
||||
| `-n, --dry-run` | Scan and print what would be transferred |
|
||||
@@ -359,6 +360,12 @@ particular, FastSync currently uses `-p` for SSH port, `-s` for chunk
|
||||
serialization, and `-S` for sparse handling. These meanings must be reconciled
|
||||
before FastSync can claim full rsync CLI compatibility.
|
||||
|
||||
`--secluded-args` is supported as a long-form compatibility option. FastSync's
|
||||
SSH transport already launches only the remote server's `--stdio` command and
|
||||
sends transfer configuration through its protocol. The rsync short form `-s`
|
||||
is intentionally not aliased because it remains FastSync's chunk-serialization
|
||||
option.
|
||||
|
||||
## Client Options
|
||||
|
||||
### Selection and transfer
|
||||
|
||||
+1
-1
@@ -233,7 +233,7 @@ This document maps rsync's full feature set to FastSync's current implementation
|
||||
| `--protocol=NUM` | Force older protocol version | ❌ Not Implemented | |
|
||||
| `--iconv=CONVERT_SPEC` | Charset conversion | ❌ Not Implemented | |
|
||||
| `--checksum-seed=NUM` | Set checksum seed | ❌ Not Implemented | |
|
||||
| `-s`, `--secluded-args` | Use protocol to send args | ❌ Not Implemented | |
|
||||
| `--secluded-args` | Use protocol to send args | ✅ Implemented | SSH already sends transfer configuration through FastSync's protocol; `-s` remains chunk serialization because of the existing FastSync short-option meaning. |
|
||||
| `--no-OPTION` | Turn off implied option | ❌ Not Implemented | |
|
||||
|
||||
---
|
||||
|
||||
@@ -146,6 +146,7 @@ static const OptionEntry OPTION_TABLE[] = {
|
||||
{"--backup", NULL, OPT_FLAG, offsetof(Config, backup)},
|
||||
{"--stats", NULL, OPT_FLAG, offsetof(Config, stats)},
|
||||
{"--partial", NULL, OPT_FLAG, offsetof(Config, partial)},
|
||||
{"--secluded-args", NULL, OPT_FLAG, offsetof(Config, use_secluded_args)},
|
||||
{"--links", "-l", OPT_FLAG, offsetof(Config, follow_symlinks)},
|
||||
{"--copy-links", NULL, OPT_FLAG, offsetof(Config, copy_links)},
|
||||
{"--safe-links", NULL, OPT_FLAG, offsetof(Config, safe_links)},
|
||||
|
||||
@@ -35,6 +35,7 @@ void print_usage(void) {
|
||||
DELTA_MAX_FILE_SIZE);
|
||||
printf(" -m Enable multithreading\n");
|
||||
printf(" -s Enable chunk serialization\n");
|
||||
printf(" --secluded-args Send transfer arguments through the protocol (SSH)\n");
|
||||
printf(" -f Enable sendfile (TCP only, not with -c or -s)\n");
|
||||
printf(" -v, --verbose Enable debug logging\n");
|
||||
printf(" -M, --preserve Preserve file metadata\n");
|
||||
|
||||
@@ -82,6 +82,7 @@ static void config_set_defaults(Config* config) {
|
||||
config->relative = false;
|
||||
config->rsh_command = NULL;
|
||||
config->rsync_path = NULL;
|
||||
config->use_secluded_args = false;
|
||||
config->temp_dir = NULL;
|
||||
config->compare_dest = NULL;
|
||||
config->copy_dest = NULL;
|
||||
|
||||
@@ -96,6 +96,7 @@ typedef struct Config {
|
||||
// Issue #130: Remote shell/connection options
|
||||
char* rsh_command;
|
||||
char* rsync_path;
|
||||
bool use_secluded_args;
|
||||
char* temp_dir;
|
||||
char* compare_dest;
|
||||
char* copy_dest;
|
||||
|
||||
@@ -339,6 +339,31 @@ static void test_parse_args_archive() {
|
||||
config_delete(cfg);
|
||||
}
|
||||
|
||||
/* --secluded-args is the rsync-compatible long form; -s keeps its FastSync meaning. */
|
||||
static void test_parse_args_secluded_args() {
|
||||
Config* cfg = config_create();
|
||||
char* argv[] = {"fastsync", "--secluded-args", "/src", "/dst"};
|
||||
int positional_args[2];
|
||||
int positional_count = 0;
|
||||
|
||||
EXPECT_EQ_INT(parse_args(cfg, 4, argv, positional_args, &positional_count), 0);
|
||||
EXPECT_TRUE(cfg->use_secluded_args);
|
||||
EXPECT_FALSE(cfg->use_chunk_serialization);
|
||||
config_delete(cfg);
|
||||
}
|
||||
|
||||
static void test_parse_args_short_s_remains_chunk_serialization() {
|
||||
Config* cfg = config_create();
|
||||
char* argv[] = {"fastsync", "-s", "/src", "/dst"};
|
||||
int positional_args[2];
|
||||
int positional_count = 0;
|
||||
|
||||
EXPECT_EQ_INT(parse_args(cfg, 4, argv, positional_args, &positional_count), 0);
|
||||
EXPECT_TRUE(cfg->use_chunk_serialization);
|
||||
EXPECT_FALSE(cfg->use_secluded_args);
|
||||
config_delete(cfg);
|
||||
}
|
||||
|
||||
void test_client_cli() {
|
||||
test_validate_config_required_paths();
|
||||
test_validate_config_incompatible_options();
|
||||
@@ -360,4 +385,6 @@ void test_client_cli() {
|
||||
test_parse_args_unknown_option();
|
||||
test_parse_args_rejects_unimplemented_options();
|
||||
test_parse_args_archive();
|
||||
test_parse_args_secluded_args();
|
||||
test_parse_args_short_s_remains_chunk_serialization();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user