summaryrefslogtreecommitdiff
path: root/options.c
diff options
context:
space:
mode:
authorWayne Davison <wayned@samba.org>2004-07-15 19:06:32 +0000
committerWayne Davison <wayned@samba.org>2004-07-15 19:06:32 +0000
commit94327ff0c2afd01f73c5e1c51f0babbb3a72cec9 (patch)
tree1f80287218f80311a96fe64c553e14d236476d0c /options.c
parent4602eafa8768331e39202929938a1861d719a8d3 (diff)
downloadrsync-94327ff0c2afd01f73c5e1c51f0babbb3a72cec9.tar.gz
rsync-94327ff0c2afd01f73c5e1c51f0babbb3a72cec9.tar.bz2
rsync-94327ff0c2afd01f73c5e1c51f0babbb3a72cec9.zip
- Complain and die if --dry-run is used with a batch option.
- Improved the warning if a batch option gets sent to the server.
Diffstat (limited to 'options.c')
-rw-r--r--options.c24
1 files changed, 17 insertions, 7 deletions
diff --git a/options.c b/options.c
index 3485a426..4179bfb5 100644
--- a/options.c
+++ b/options.c
@@ -640,13 +640,23 @@ int parse_arguments(int *argc, const char ***argv, int frommain)
"write-batch and read-batch can not be used together\n");
exit_cleanup(RERR_SYNTAX);
}
- if ((write_batch || read_batch) && am_server) {
- rprintf(FERROR,
- "batch-mode is incompatible with server mode\n");
- /* We don't actually exit_cleanup(), so that we can still service
- * older version clients that still send batch args to server. */
- read_batch = write_batch = 0;
- batch_name = NULL;
+ if (write_batch || read_batch) {
+ if (dry_run) {
+ rprintf(FERROR,
+ "--%s-batch cannot be used with --dry_run (-n)\n",
+ write_batch ? "write" : "read");
+ exit_cleanup(RERR_SYNTAX);
+ }
+ if (am_server) {
+ rprintf(FINFO,
+ "ignoring --%s-batch option sent to server\n",
+ write_batch ? "write" : "read");
+ /* We don't actually exit_cleanup(), so that we can
+ * still service older version clients that still send
+ * batch args to server. */
+ read_batch = write_batch = 0;
+ batch_name = NULL;
+ }
}
if (batch_name && strlen(batch_name) > MAX_BATCH_NAME_LEN) {
rprintf(FERROR,