Use "#if" (not "#ifdef") for configure-defined macros.
[rsync/rsync.git] / options.c
index 28936f0..4687802 100644 (file)
--- a/options.c
+++ b/options.c
@@ -70,7 +70,6 @@ int implied_dirs = 1;
 int numeric_ids = 0;
 int force_delete = 0;
 int io_timeout = 0;
-int read_only = 0;
 int module_id = -1;
 int am_server = 0;
 int am_sender = 0;
@@ -106,7 +105,7 @@ long block_size = 0; /* "long" because popt can't set an int32. */
 
 
 /** Network address family. **/
-#ifdef INET6
+#if INET6
 int default_af_hint = 0;       /* Any protocol */
 #else
 int default_af_hint = AF_INET; /* Must use IPv4 */
@@ -169,7 +168,7 @@ static void print_rsync_version(enum logcode f)
        char const *ipv6 = "no ";
        STRUCT_STAT *dumstat;
 
-#ifdef HAVE_SOCKETPAIR
+#if HAVE_SOCKETPAIR
        got_socketpair = "";
 #endif
 
@@ -328,7 +327,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");
-#ifdef INET6
+#if INET6
   rprintf(F," -4, --ipv4                  prefer IPv4\n");
   rprintf(F," -6, --ipv6                  prefer IPv6\n");
 #endif
@@ -433,7 +432,7 @@ static struct poptOption long_options[] = {
   {"no-implied-dirs",  0,  POPT_ARG_VAL,    &implied_dirs, 0, 0, 0 },
   {"protocol",         0,  POPT_ARG_INT,    &protocol_version, 0, 0, 0 },
   {"checksum-seed",    0,  POPT_ARG_INT,    &checksum_seed, 0, 0, 0 },
-#ifdef INET6
+#if INET6
   {"ipv4",            '4', POPT_ARG_VAL,    &default_af_hint, AF_INET, 0, 0 },
   {"ipv6",            '6', POPT_ARG_VAL,    &default_af_hint, AF_INET6, 0, 0 },
 #endif
@@ -455,7 +454,8 @@ static void daemon_usage(enum logcode F)
   rprintf(F,"     --config=FILE           specify alternate rsyncd.conf file\n");
   rprintf(F,"     --no-detach             do not detach from the parent\n");
   rprintf(F,"     --port=PORT             listen on alternate port number\n");
-#ifdef INET6
+  rprintf(F," -v, --verbose               increase verbosity\n");
+#if INET6
   rprintf(F," -4, --ipv4                  prefer IPv4\n");
   rprintf(F," -6, --ipv6                  prefer IPv6\n");
 #endif
@@ -471,7 +471,7 @@ static struct poptOption long_daemon_options[] = {
   {"bwlimit",          0,  POPT_ARG_INT,    &daemon_bwlimit, 0, 0, 0 },
   {"config",           0,  POPT_ARG_STRING, &config_file, 0, 0, 0 },
   {"daemon",           0,  POPT_ARG_NONE,   &daemon_opt, 0, 0, 0 },
-#ifdef INET6
+#if INET6
   {"ipv4",            '4', POPT_ARG_VAL,    &default_af_hint, AF_INET, 0, 0 },
   {"ipv6",            '6', POPT_ARG_VAL,    &default_af_hint, AF_INET6, 0, 0 },
 #endif
@@ -479,6 +479,7 @@ static struct poptOption long_daemon_options[] = {
   {"port",             0,  POPT_ARG_INT,    &rsync_port, 0, 0, 0 },
   {"protocol",         0,  POPT_ARG_INT,    &protocol_version, 0, 0, 0 },
   {"server",           0,  POPT_ARG_NONE,   &am_server, 0, 0, 0 },
+  {"verbose",         'v', POPT_ARG_NONE,   0, 'v', 0, 0 },
   {"help",            'h', POPT_ARG_NONE,   0, 'h', 0, 0 },
   {0,0,0,0, 0, 0, 0}
 };
@@ -623,6 +624,10 @@ int parse_arguments(int *argc, const char ***argv, int frommain)
                                        daemon_usage(FINFO);
                                        exit_cleanup(0);
 
+                               case 'v':
+                                       verbose++;
+                                       break;
+
                                default:
                                        rprintf(FERROR,
                                            "rsync: %s: %s (in daemon mode)\n",