- Allow the infix field width to start with a '-'.
[rsync/rsync.git] / options.c
index a9f4c2d..14b6634 100644 (file)
--- a/options.c
+++ b/options.c
@@ -345,6 +345,7 @@ void usage(enum logcode F)
   rprintf(F,"     --bwlimit=KBPS          limit I/O bandwidth; KBytes per second\n");
   rprintf(F,"     --write-batch=FILE      write a batched update to FILE\n");
   rprintf(F,"     --read-batch=FILE       read a batched update from FILE\n");
+  rprintf(F,"     --protocol=NUM          force an older protocol version to be used\n");
 #ifdef INET6
   rprintf(F," -4, --ipv4                  prefer IPv4\n");
   rprintf(F," -6, --ipv6                  prefer IPv6\n");
@@ -901,12 +902,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 +911,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,
@@ -1301,7 +1297,7 @@ void server_options(char **args,int *argc)
        /* This is a complete hack - blame Rusty.  FIXME!
         * This hack is only needed for older rsync versions that
         * don't understand the --list-only option. */
-       if (list_only == 1 && recurse)
+       if (list_only == 1 && !recurse)
                argstr[x++] = 'r';
 
        argstr[x] = 0;