feat: add rsync partial progress alias
CI / lint (pull_request) Successful in 11s
CI / sanitizers (address) (pull_request) Successful in 38s
CI / sanitizers (undefined) (pull_request) Successful in 37s
CI / fuzz-build (pull_request) Successful in 14s
CI / coverage (pull_request) Successful in 32s
CI / build-and-test (pull_request) Successful in 1m15s
CI / valgrind (pull_request) Successful in 32s
CI / lint (pull_request) Successful in 11s
CI / sanitizers (address) (pull_request) Successful in 38s
CI / sanitizers (undefined) (pull_request) Successful in 37s
CI / fuzz-build (pull_request) Successful in 14s
CI / coverage (pull_request) Successful in 32s
CI / build-and-test (pull_request) Successful in 1m15s
CI / valgrind (pull_request) Successful in 32s
This commit is contained in:
@@ -95,6 +95,7 @@ partial, alternate, and planned behavior.
|
|||||||
| `-p <port>` | SSH port (default: 22) |
|
| `-p <port>` | SSH port (default: 22) |
|
||||||
| `-v, --verbose` | Enable debug logging |
|
| `-v, --verbose` | Enable debug logging |
|
||||||
| `--progress` | Show real-time transfer speed |
|
| `--progress` | Show real-time transfer speed |
|
||||||
|
| `-P` | Alias for `--partial --progress` |
|
||||||
| `--delete` | Delete files on receiver not present in source |
|
| `--delete` | Delete files on receiver not present in source |
|
||||||
| `--exclude <pattern>` | Exclude files matching glob pattern (repeatable) |
|
| `--exclude <pattern>` | Exclude files matching glob pattern (repeatable) |
|
||||||
| `--exclude-from <file>` | Read exclude patterns from a file (one per line) |
|
| `--exclude-from <file>` | Read exclude patterns from a file (one per line) |
|
||||||
|
|||||||
+3
-3
@@ -6,10 +6,10 @@ This document maps rsync's full feature set to FastSync's current implementation
|
|||||||
|
|
||||||
| Status | Count | Description |
|
| Status | Count | Description |
|
||||||
|--------|-------|-------------|
|
|--------|-------|-------------|
|
||||||
| ✅ Implemented | 34 | Feature works end-to-end |
|
| ✅ Implemented | 35 | Feature works end-to-end |
|
||||||
| 🔀 Alt Arg | 3 | Functionality exists but under different flag/semantics |
|
| 🔀 Alt Arg | 3 | Functionality exists but under different flag/semantics |
|
||||||
| ⚠️ Partial | 1 | Flag parsed/stored but behavior incomplete |
|
| ⚠️ Partial | 1 | Flag parsed/stored but behavior incomplete |
|
||||||
| ❌ Not Implemented | 98 | Flag not recognized or no behavior |
|
| ❌ Not Implemented | 97 | Flag not recognized or no behavior |
|
||||||
| **Total** | **136** | |
|
| **Total** | **136** | |
|
||||||
|
|
||||||
---
|
---
|
||||||
@@ -39,7 +39,7 @@ This document maps rsync's full feature set to FastSync's current implementation
|
|||||||
| `-h`, `--human-readable` | Human-readable numbers | ❌ Not Implemented | Removed because it had no effect |
|
| `-h`, `--human-readable` | Human-readable numbers | ❌ Not Implemented | Removed because it had no effect |
|
||||||
| `-i`, `--itemize-changes` | Per-file change summary | ❌ Not Implemented | Removed because it had no effect |
|
| `-i`, `--itemize-changes` | Per-file change summary | ❌ Not Implemented | Removed because it had no effect |
|
||||||
| `--progress` | Show progress | ✅ Implemented | Progress callback in sender |
|
| `--progress` | Show progress | ✅ Implemented | Progress callback in sender |
|
||||||
| `-P` | Same as --partial --progress | ❌ Not Implemented | |
|
| `-P` | Same as --partial --progress | ✅ Implemented | Enables both existing `--partial` and `--progress` behavior |
|
||||||
| `--out-format=FORMAT` | Custom output format | ❌ Not Implemented | Removed because it had no effect |
|
| `--out-format=FORMAT` | Custom output format | ❌ Not Implemented | Removed because it had no effect |
|
||||||
| `--log-file=FILE` | Log to file | ✅ Implemented | `log_file` config field |
|
| `--log-file=FILE` | Log to file | ✅ Implemented | `log_file` config field |
|
||||||
| `--log-file-format=FMT` | Log format | ❌ Not Implemented | |
|
| `--log-file-format=FMT` | Log format | ❌ Not Implemented | |
|
||||||
|
|||||||
@@ -211,6 +211,12 @@ static int apply_table_option(Config* config, const OptionEntry* entry, const ch
|
|||||||
int parse_args(Config* config, int argc, char* argv[], int* positional_args,
|
int parse_args(Config* config, int argc, char* argv[], int* positional_args,
|
||||||
int* positional_count) {
|
int* positional_count) {
|
||||||
for (int i = 1; i < argc; i++) {
|
for (int i = 1; i < argc; i++) {
|
||||||
|
if (strcmp(argv[i], "-P") == 0) {
|
||||||
|
config->partial = true;
|
||||||
|
config->show_progress = true;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
const OptionEntry* entry = find_table_option(argv[i]);
|
const OptionEntry* entry = find_table_option(argv[i]);
|
||||||
if (entry) {
|
if (entry) {
|
||||||
if (entry->kind != OPT_FLAG) {
|
if (entry->kind != OPT_FLAG) {
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ void print_usage(void) {
|
|||||||
printf(" -n, --dry-run Show what would be transferred\n");
|
printf(" -n, --dry-run Show what would be transferred\n");
|
||||||
printf(" -p <port> SSH port (default: 22)\n");
|
printf(" -p <port> SSH port (default: 22)\n");
|
||||||
printf(" --progress Show transfer progress\n");
|
printf(" --progress Show transfer progress\n");
|
||||||
|
printf(" -P Alias for --partial --progress\n");
|
||||||
printf(" --delete Delete files on receiver not in source\n");
|
printf(" --delete Delete files on receiver not in source\n");
|
||||||
printf(" --exclude <pattern> Exclude files matching pattern\n");
|
printf(" --exclude <pattern> Exclude files matching pattern\n");
|
||||||
printf(" --include <pattern> Only include files matching pattern\n");
|
printf(" --include <pattern> Only include files matching pattern\n");
|
||||||
|
|||||||
@@ -339,6 +339,22 @@ static void test_parse_args_archive() {
|
|||||||
config_delete(cfg);
|
config_delete(cfg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Test rsync-compatible -P enables both partial files and progress output. */
|
||||||
|
static void test_parse_args_partial_progress() {
|
||||||
|
Config* cfg = config_create();
|
||||||
|
char* argv[] = {"fastsync", "-P", "/src", "/dst"};
|
||||||
|
int positional_args[2];
|
||||||
|
int positional_count = 0;
|
||||||
|
|
||||||
|
int ret = parse_args(cfg, 4, argv, positional_args, &positional_count);
|
||||||
|
EXPECT_EQ_INT(ret, 0);
|
||||||
|
EXPECT_TRUE(cfg->partial);
|
||||||
|
EXPECT_TRUE(cfg->show_progress);
|
||||||
|
EXPECT_EQ_INT(positional_count, 2);
|
||||||
|
|
||||||
|
config_delete(cfg);
|
||||||
|
}
|
||||||
|
|
||||||
void test_client_cli() {
|
void test_client_cli() {
|
||||||
test_validate_config_required_paths();
|
test_validate_config_required_paths();
|
||||||
test_validate_config_incompatible_options();
|
test_validate_config_incompatible_options();
|
||||||
@@ -360,4 +376,5 @@ void test_client_cli() {
|
|||||||
test_parse_args_unknown_option();
|
test_parse_args_unknown_option();
|
||||||
test_parse_args_rejects_unimplemented_options();
|
test_parse_args_rejects_unimplemented_options();
|
||||||
test_parse_args_archive();
|
test_parse_args_archive();
|
||||||
|
test_parse_args_partial_progress();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user