- Don't complain if --dry-run is specified with --read-batch
authorWayne Davison <wayned@samba.org>
Thu, 24 Mar 2005 16:41:16 +0000 (16:41 +0000)
committerWayne Davison <wayned@samba.org>
Thu, 24 Mar 2005 16:41:16 +0000 (16:41 +0000)
  or --write-batch.
- If --write-batch is combined with --dry-run, just disable
  --write-batch (that avoids trying to create a batch file
  and tells the user what would be transferred).

options.c

index b650057..301178d 100644 (file)
--- a/options.c
+++ b/options.c
@@ -901,12 +901,6 @@ int parse_arguments(int *argc, const char ***argv, int frommain)
                return 0;
        }
        if (write_batch || read_batch) {
-               if (dry_run) {
-                       snprintf(err_buf, sizeof err_buf,
-                               "--%s-batch cannot be used with --dry_run (-n)\n",
-                               write_batch ? "write" : "read");
-                       return 0;
-               }
                if (am_server) {
                        rprintf(FINFO,
                                "ignoring --%s-batch option sent to server\n",
@@ -916,7 +910,8 @@ int parse_arguments(int *argc, const char ***argv, int frommain)
                         * batch args to server. */
                        read_batch = write_batch = 0;
                        batch_name = NULL;
-               }
+               } else if (dry_run)
+                       write_batch = 0;
        }
        if (read_batch && files_from) {
                snprintf(err_buf, sizeof err_buf,