X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/1312d9fc47482817a296c29abfd5d1b9ab5c58b1..066696644f8fa36f5ca3be116d015ded400266de:/options.c diff --git a/options.c b/options.c index 42d4a155..3bfd833e 100644 --- a/options.c +++ b/options.c @@ -81,11 +81,7 @@ int only_existing=0; int opt_ignore_existing=0; int max_delete=0; int ignore_errors=0; -#ifdef _WIN32 -int modify_window=2; -#else -int modify_window=0; -#endif +int modify_window=DEFAULT_MODIFY_WINDOW; int blocking_io=-1; @@ -108,13 +104,14 @@ int suffix_specified = 0; char *backup_suffix = BACKUP_SUFFIX; char *tmpdir = NULL; char *compare_dest = NULL; -char *config_file = RSYNCD_CONF; +char *config_file = NULL; char *shell_cmd = NULL; char *log_format = NULL; char *password_file = NULL; char *rsync_path = RSYNC_PATH; char *backup_dir = NULL; int rsync_port = RSYNC_PORT; +int link_dest = 0; int verbose = 0; int quiet = 0; @@ -202,6 +199,7 @@ void usage(enum logcode F) rprintf(F," or rsync [OPTION]... [USER@]HOST::SRC [DEST]\n"); rprintf(F," or rsync [OPTION]... SRC [SRC]... [USER@]HOST::DEST\n"); rprintf(F," or rsync [OPTION]... rsync://[USER@]HOST[:PORT]/SRC [DEST]\n"); + rprintf(F," or rsync [OPTION]... SRC [SRC]... rsync://[USER@]HOST[:PORT]/DEST\n"); rprintf(F,"SRC on single-colon remote HOST will be expanded by remote shell\n"); rprintf(F,"SRC on server remote HOST may contain shell wildcards or multiple\n"); rprintf(F," sources separated by space as long as they have same top-level\n"); @@ -209,7 +207,7 @@ void usage(enum logcode F) rprintf(F," -v, --verbose increase verbosity\n"); rprintf(F," -q, --quiet decrease verbosity\n"); rprintf(F," -c, --checksum always checksum\n"); - rprintf(F," -a, --archive archive mode\n"); + rprintf(F," -a, --archive archive mode, equivalent to -rlptgoD\n"); rprintf(F," -r, --recursive recurse into directories\n"); rprintf(F," -R, --relative use relative path names\n"); rprintf(F," -b, --backup make backups (default %s suffix)\n",BACKUP_SUFFIX); @@ -288,7 +286,7 @@ enum {OPT_VERSION = 1000, OPT_SUFFIX, OPT_SENDER, OPT_SERVER, OPT_EXCLUDE, OPT_EXCLUDE_FROM, OPT_DELETE, OPT_DELETE_EXCLUDED, OPT_NUMERIC_IDS, OPT_RSYNC_PATH, OPT_FORCE, OPT_TIMEOUT, OPT_DAEMON, OPT_CONFIG, OPT_PORT, OPT_INCLUDE, OPT_INCLUDE_FROM, OPT_STATS, OPT_PARTIAL, OPT_PROGRESS, - OPT_COPY_UNSAFE_LINKS, OPT_SAFE_LINKS, OPT_COMPARE_DEST, + OPT_COPY_UNSAFE_LINKS, OPT_SAFE_LINKS, OPT_COMPARE_DEST, OPT_LINK_DEST, OPT_LOG_FORMAT, OPT_PASSWORD_FILE, OPT_SIZE_ONLY, OPT_ADDRESS, OPT_DELETE_AFTER, OPT_EXISTING, OPT_MAX_DELETE, OPT_BACKUP_DIR, OPT_IGNORE_ERRORS, OPT_BWLIMIT, OPT_BLOCKING_IO, @@ -347,6 +345,7 @@ static struct poptOption long_options[] = { {"timeout", 0, POPT_ARG_INT, &io_timeout , 0, 0, 0 }, {"temp-dir", 'T', POPT_ARG_STRING, &tmpdir , 0, 0, 0 }, {"compare-dest", 0, POPT_ARG_STRING, &compare_dest , 0, 0, 0 }, + {"link-dest", 0, POPT_ARG_STRING, 0, OPT_LINK_DEST, 0, 0 }, /* TODO: Should this take an optional int giving the compression level? */ {"compress", 'z', POPT_ARG_NONE, &do_compression , 0, 0, 0 }, {"daemon", 0, POPT_ARG_NONE, &am_daemon , 0, 0, 0 }, @@ -590,6 +589,19 @@ int parse_arguments(int *argc, const char ***argv, int frommain) /* popt stores the filename in batch_prefix for us */ read_batch = 1; break; + case OPT_LINK_DEST: +#if HAVE_LINK + compare_dest = (char *)poptGetOptArg(pc); + link_dest = 1; + break; +#else + snprintf(err_buf,sizeof(err_buf), + "hard links are not supported on this %s\n", + am_server ? "server" : "client"); + rprintf(FERROR,"ERROR: hard links not supported on this platform\n"); + return 0; +#endif + default: /* FIXME: If --daemon is specified, then errors for later @@ -826,7 +838,7 @@ void server_options(char **args,int *argc) * and it may be an older version that doesn't know this * option, so don't send it if client is the sender. */ - args[ac++] = "--compare-dest"; + args[ac++] = link_dest ? "--link-dest" : "--compare-dest"; args[ac++] = compare_dest; }