Matt McCutchen's Web Site
/
rsync
/
rsync.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
cosmetic fix.
[rsync/rsync.git]
/
options.c
diff --git
a/options.c
b/options.c
index
3e2b714
..
434defd
100644
(file)
--- a/
options.c
+++ b/
options.c
@@
-54,6
+54,7
@@
int am_server = 0;
int am_sender=0;
int recurse = 0;
int am_daemon=0;
int am_sender=0;
int recurse = 0;
int am_daemon=0;
+int am_client=0;
int block_size=BLOCK_SIZE;
int block_size=BLOCK_SIZE;
@@
-78,7
+79,7
@@
void usage(int F)
rprintf(F,"Options:\n");
rprintf(F,"-v, --verbose increase verbosity\n");
rprintf(F,"-c, --checksum always checksum\n");
rprintf(F,"Options:\n");
rprintf(F,"-v, --verbose increase verbosity\n");
rprintf(F,"-c, --checksum always checksum\n");
- rprintf(F,"-a, --archive archive mode
(same as -rlptDog)
\n");
+ rprintf(F,"-a, --archive archive mode\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 ~ extension)\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 ~ extension)\n");
@@
-108,6
+109,8
@@
void usage(int F)
rprintf(F,"-z, --compress compress file data\n");
rprintf(F," --exclude FILE exclude file FILE\n");
rprintf(F," --exclude-from FILE exclude files listed in FILE\n");
rprintf(F,"-z, --compress compress file data\n");
rprintf(F," --exclude FILE exclude file FILE\n");
rprintf(F," --exclude-from FILE exclude files listed in FILE\n");
+ rprintf(F," --include FILE don't exclude file FILE\n");
+ rprintf(F," --include-from FILE don't exclude files listed in FILE\n");
rprintf(F," --suffix SUFFIX override backup suffix\n");
rprintf(F," --version print version number\n");
rprintf(F," --daemon run as a rsync daemon\n");
rprintf(F," --suffix SUFFIX override backup suffix\n");
rprintf(F," --version print version number\n");
rprintf(F," --daemon run as a rsync daemon\n");
@@
-121,7
+124,8
@@
void usage(int F)
enum {OPT_VERSION,OPT_SUFFIX,OPT_SENDER,OPT_SERVER,OPT_EXCLUDE,
OPT_EXCLUDE_FROM,OPT_DELETE,OPT_NUMERIC_IDS,OPT_RSYNC_PATH,
enum {OPT_VERSION,OPT_SUFFIX,OPT_SENDER,OPT_SERVER,OPT_EXCLUDE,
OPT_EXCLUDE_FROM,OPT_DELETE,OPT_NUMERIC_IDS,OPT_RSYNC_PATH,
- OPT_FORCE,OPT_TIMEOUT,OPT_DAEMON,OPT_CONFIG,OPT_PORT};
+ OPT_FORCE,OPT_TIMEOUT,OPT_DAEMON,OPT_CONFIG,OPT_PORT,
+ OPT_INCLUDE, OPT_INCLUDE_FROM};
static char *short_options = "oblLWHpguDCtcahvrRIxnSe:B:T:z";
static char *short_options = "oblLWHpguDCtcahvrRIxnSe:B:T:z";
@@
-134,6
+138,8
@@
static struct option long_options[] = {
{"numeric-ids", 0, 0, OPT_NUMERIC_IDS},
{"exclude", 1, 0, OPT_EXCLUDE},
{"exclude-from",1, 0, OPT_EXCLUDE_FROM},
{"numeric-ids", 0, 0, OPT_NUMERIC_IDS},
{"exclude", 1, 0, OPT_EXCLUDE},
{"exclude-from",1, 0, OPT_EXCLUDE_FROM},
+ {"include", 1, 0, OPT_INCLUDE},
+ {"include-from",1, 0, OPT_INCLUDE_FROM},
{"rsync-path", 1, 0, OPT_RSYNC_PATH},
{"one-file-system",0, 0, 'x'},
{"ignore-times",0, 0, 'I'},
{"rsync-path", 1, 0, OPT_RSYNC_PATH},
{"one-file-system",0, 0, 'x'},
{"ignore-times",0, 0, 'I'},
@@
-212,11
+218,19
@@
void parse_arguments(int argc, char *argv[])
break;
case OPT_EXCLUDE:
break;
case OPT_EXCLUDE:
- add_exclude(optarg);
+ add_exclude(optarg, 0);
+ break;
+
+ case OPT_INCLUDE:
+ add_exclude(optarg, 1);
break;
case OPT_EXCLUDE_FROM:
break;
case OPT_EXCLUDE_FROM:
- add_exclude_file(optarg,1);
+ add_exclude_file(optarg,1, 0);
+ break;
+
+ case OPT_INCLUDE_FROM:
+ add_exclude_file(optarg,1, 1);
break;
case 'h':
break;
case 'h':