int write_batch = 0;
int read_batch = 0;
+int suffix_specified = 0;
char *backup_suffix = BACKUP_SUFFIX;
char *tmpdir = NULL;
rprintf(F," --no-whole-file turn off --whole-file\n");
rprintf(F," -x, --one-file-system don't cross filesystem boundaries\n");
rprintf(F," -B, --block-size=SIZE checksum blocking size (default %d)\n",BLOCK_SIZE);
- rprintf(F," -e, --rsh=COMMAND specify rsh replacement\n");
+ rprintf(F," -e, --rsh=COMMAND specify the remote shell\n");
rprintf(F," --rsync-path=PATH specify path to rsync on the remote machine\n");
rprintf(F," -C, --cvs-exclude auto ignore files in the same way CVS does\n");
rprintf(F," --existing only update files that already exist\n");
static struct poptOption long_options[] = {
/* longName, shortName, argInfo, argPtr, value, descrip, argDesc */
{"version", 0, POPT_ARG_NONE, 0, OPT_VERSION, 0, 0},
- {"suffix", 0, POPT_ARG_STRING, &backup_suffix, 0, 0, 0 },
+ {"suffix", 0, POPT_ARG_STRING, &backup_suffix, OPT_SUFFIX, 0, 0 },
{"rsync-path", 0, POPT_ARG_STRING, &rsync_path, 0, 0, 0 },
{"password-file", 0, POPT_ARG_STRING, &password_file, 0, 0, 0 },
{"ignore-times", 'I', POPT_ARG_NONE, &ignore_times , 0, 0, 0 },
{"delete", 0, POPT_ARG_NONE, &delete_mode , 0, 0, 0 },
{"existing", 0, POPT_ARG_NONE, &only_existing , 0, 0, 0 },
{"ignore-existing", 0, POPT_ARG_NONE, &opt_ignore_existing , 0, 0, 0 },
- {"delete-after", 0, POPT_ARG_NONE, &delete_after , 0, 0, 0 },
+ {"delete-after", 0, POPT_ARG_NONE, 0, OPT_DELETE_AFTER, 0, 0 },
{"delete-excluded", 0, POPT_ARG_NONE, 0, OPT_DELETE_EXCLUDED, 0, 0 },
{"force", 0, POPT_ARG_NONE, &force_delete , 0, 0, 0 },
{"numeric-ids", 0, POPT_ARG_NONE, &numeric_ids , 0, 0, 0 },
print_rsync_version(FINFO);
exit_cleanup(0);
+ case OPT_SUFFIX:
+ /* The value has already been set by popt, but
+ * we need to remember that a suffix was specified
+ * in case a backup-directory is used. */
+ suffix_specified = 1;
+ break;
+
case OPT_MODIFY_WINDOW:
/* The value has already been set by popt, but
* we need to remember that we're using a
* non-default setting. */
modify_window_set = 1;
break;
-
+
+ case OPT_DELETE_AFTER:
+ delete_after = 1;
+ delete_mode = 1;
+ break;
+
case OPT_DELETE_EXCLUDED:
delete_excluded = 1;
delete_mode = 1;