Improve the "--delete does not work without -r or -d" message.
[rsync.git] / options.c
index 75fa1ab6147905295e24262e01b986dbbb47ecc5..7b9e5a8d36b3125be0893058a7f64b41f82d2d0a 100644 (file)
--- a/options.c
+++ b/options.c
@@ -1357,6 +1357,12 @@ int parse_arguments(int *argc_p, const char ***argv_p)
                        "--read-batch cannot be used with --files-from\n");
                return 0;
        }
+       if (read_batch && remove_source_files) {
+               snprintf(err_buf, sizeof err_buf,
+                       "--read-batch cannot be used with --remove-%s-files\n",
+                       remove_source_files == 1 ? "source" : "sent");
+               return 0;
+       }
        if (batch_name && strlen(batch_name) > MAX_BATCH_NAME_LEN) {
                snprintf(err_buf, sizeof err_buf,
                        "the batch-file name must be %d characters or less.\n",
@@ -1426,7 +1432,7 @@ int parse_arguments(int *argc_p, const char ***argv_p)
        }
        if (!xfer_dirs && delete_mode) {
                snprintf(err_buf, sizeof err_buf,
-                       "--delete does not work without -r or -d.\n");
+                       "--delete does not work without --recursive (-r) or --dirs (-d).\n");
                return 0;
        }