#include "usage.h" #include #include #include void print_usage(void) { printf("Usage:\n"); printf(" fastsync [options] \n"); printf(" fastsync [options] --source-dir --dest-dir \n"); printf("\n"); printf("Destination formats:\n"); printf(" user@host:/path SSH transport (rsync-style)\n"); printf(" host:/path SSH transport (current user)\n"); printf(" /local/path TCP transport (requires server on localhost:8080)\n"); printf("\n"); printf("Options:\n"); printf(" -c [level] Enable compression (level 1-22, default 5)\n"); printf(" -z [level] Alias for -c\n"); printf(" -a, --archive Archive mode (-c -m -M)\n"); printf(" -n, --dry-run Show what would be transferred\n"); printf(" --remove-source-files Remove regular source files after successful transfer\n"); printf(" -p SSH port (default: 22)\n"); printf(" --progress Show transfer progress\n"); printf(" -P Partial mode with progress (retention incomplete)\n"); printf(" -8, --8-bit-output Leave high-bit characters unescaped in output\n"); printf(" --delete Delete files on receiver not in source\n"); printf(" (default timing: delete only after the whole\n"); printf(" transfer has succeeded)\n"); printf(" --delete-before Delete extras before the transfer starts\n"); printf(" (implies --delete)\n"); printf(" --delete-during Delete extras once the keep-set is known, before\n"); printf(" --del data is applied (alias --del; implies --delete)\n"); printf(" --delete-delay Delete extras only after a successful transfer\n"); printf(" (implies --delete)\n"); printf(" --delete-after Alias of the default --delete timing: delete only\n"); printf(" after the transfer succeeded (implies --delete)\n"); printf(" --ignore-existing Skip files that already exist on receiver\n"); printf(" --delay-updates Put updated files into place only at the end of transfer\n"); printf(" --dirs, -d, --old-dirs, --old-d Transfer the named directory entries without\n"); printf(" recursing into their contents (-d mirrors the source\n"); printf(" directory empty; with --files-from listed dirs are created\n"); printf(" empty and listed files are transferred)\n"); printf(" -R, --relative With --files-from, preserve each listed entry's relative path\n"); printf(" below the destination root instead of mirroring the full\n"); printf(" source path (no effect without --files-from)\n"); printf(" --no-implied-dirs With -R --files-from, refuse to place a listed file whose\n"); printf(" parent directory is not itself listed\n"); printf(" --mkpath Create the destination root directory on the server when it\n"); printf(" does not exist yet\n"); printf(" --exclude Exclude files matching pattern\n"); printf(" --include Only include files matching pattern\n"); printf(" --exclude-from Read exclude patterns from file\n"); printf(" --include-from Read include patterns from file\n"); printf(" --files-from Read the source file list from FILE (paths relative to the " "source root)\n"); printf(" -0, --from0 Entries in --files-from are NUL-delimited\n"); printf(" --filter=RULE rsync-style filter rule (+/- include/exclude; repeatable; the\n"); printf(" rsync -f short form conflicts with FastSync sendfile -f)\n"); printf(" -C, --cvs-exclude Auto-ignore common CVS/SCM files (.git/, .svn/, *.o, *~, ...)\n"); printf(" -F Apply per-directory .rsync-filter files during the scan\n"); printf(" --max-size Skip files larger than n bytes\n"); printf(" --min-size Skip files smaller than n bytes\n"); printf(" --max-alloc Maximum single allocation (default: 1G)\n"); printf(" --incremental Skip files unchanged since last transfer\n"); printf(" --size-only Skip incremental files matching in size, ignoring mtime\n"); printf(" -I, --ignore-times Transfer files even when size and mtime match\n"); printf(" -@, --modify-window Modification time tolerance\n"); printf(" -u, --update Skip files newer than the source on receiver\n"); printf(" --existing Skip files not already present at destination\n"); printf(" --checksum-choice, --cc Checksum algorithm (not supported yet; xxHash64 is " "used)\n"); printf(" --delta Delta transfer for changed files (requires --incremental)\n"); printf(" -W, --whole-file Transfer changed files without delta processing\n"); printf(" --delta-block Delta block size in bytes (default: %d)\n", DELTA_BLOCK_SIZE_DEFAULT); printf(" --delta-max Max file size for delta transfer (default: %llu)\n", DELTA_MAX_FILE_SIZE); printf(" -m Enable multithreading\n"); printf(" -s Enable chunk serialization\n"); printf(" --secluded-args Accept rsync compatibility option (no effect)\n"); printf(" -f Enable sendfile (TCP only, not with -c or -s)\n"); printf(" --compress-choice Compression algorithm (default: zstd)\n"); printf(" --zc Alias for --compress-choice\n"); printf(" -v, --verbose Enable debug logging\n"); printf(" -q, --quiet Suppress non-error output\n"); printf(" --debug=FLAGS Fine-grained debug logging (use --debug=help for flags)\n"); printf(" --info=FLAGS Fine-grained info: copy,misc,skip,stats,all,none\n"); printf(" none suppresses info even with --verbose\n"); printf(" -M, --preserve Preserve file metadata\n"); printf(" -E, --executability Preserve executable permission bits\n"); printf(" --chmod Modify transferred permissions (rsync syntax)\n"); printf(" --chunk-size Chunk size in bytes (default: %d)\n", DEFAULT_CHUNK_SIZE); printf(" --source-dir Source directory\n"); printf(" --dest-dir Destination directory\n"); printf(" --save-to-disk Write received files to disk\n"); printf(" --server-host Server IP address (default: 127.0.0.1)\n"); printf(" --server-port Server port (default: 8080)\n"); printf(" --bwlimit Bandwidth limit in kilobytes per second\n"); printf(" --tls Enable TLS encryption\n"); printf(" --cert TLS certificate file (PEM)\n"); printf(" --key TLS private key file (PEM)\n"); printf(" --ca TLS CA certificate file (PEM)\n"); printf(" --timeout I/O timeout in seconds (default: 30)\n"); printf(" -T Alias for --timeout\n"); printf(" --contimeout Connection timeout in seconds (default: 10)\n"); printf(" --backup Backup existing files before overwriting\n"); printf(" --backup-dir Directory for backups (requires --backup)\n"); printf(" --suffix Backup suffix (default: ~)\n"); printf(" --stats Print transfer statistics at end\n"); printf(" -i, --itemize-changes Print an rsync-style per-file change line\n"); printf(" --out-format=FORMAT Output format for changed files (%%f %%n %%l %%b %%M %%%%)\n"); printf(" --list-only List source files instead of transferring\n"); printf(" --log-file-format=FORMAT Per-file log line format (needs --log-file)\n"); printf(" -h, --human-readable Print byte sizes in human-readable form\n"); printf(" --max-depth Maximum directory depth (0=unlimited)\n"); printf(" -x, --one-file-system Do not cross filesystem boundaries\n"); printf(" --log-file Write log messages to file\n"); printf(" --stderr=MODE Route logging to stderr: errors or all\n"); printf(" --partial Keep partial files on interrupted transfer\n"); printf(" --partial-dir Directory for partial files\n"); printf(" --temp-dir Scratch dir for temp files before atomic install\n"); printf(" --fastsync-server-path \n"); printf(" Path to fastsync-server on remote (default: fastsync-server)\n"); printf( " --old-args Disable safe SSH command argument quoting (legacy compatibility)\n"); printf(" -l, --links Copy symlinks as symlinks\n"); printf(" --copy-links Transform symlinks into referent files\n"); printf(" --safe-links Skip symlinks that point outside transfer tree\n"); printf(" --copy-unsafe-links Only transform unsafe symlinks into referent files\n"); printf(" -S, --sparse Handle sparse files efficiently\n"); printf(" --inplace Update files in-place (no temp+rename)\n"); printf(" --fsync Fsync every written file before publication\n"); printf(" --compress-level Compression level (default: 5)\n"); printf(" --zl Alias for --compress-level\n"); printf(" --skip-compress=LIST Skip compression for comma-separated suffixes\n"); printf(" --compress-threads Compression worker threads (requires zstd threaded support)\n"); printf(" --no-OPTION Disable a supported boolean option\n"); printf(" --help Show this help\n"); printf(" -V, --version Show version\n"); } void print_debug_usage(void) { printf("Supported debug flags: IO,PROTO,PACK,UTIL,ALL,NONE\n"); printf("Flags may be comma-separated, for example: --debug=io,proto\n"); printf("Other rsync debug flags are unsupported and rejected.\n"); }