+ /* All these options switch us into daemon-mode option-parsing. */
+ {"address", 0, POPT_ARG_STRING, 0, OPT_DAEMON, 0, 0 },
+ {"config", 0, POPT_ARG_STRING, 0, OPT_DAEMON, 0, 0 },
+ {"daemon", 0, POPT_ARG_NONE, 0, OPT_DAEMON, 0, 0 },
+ {"detach", 0, POPT_ARG_NONE, 0, OPT_DAEMON, 0, 0 },
+ {"no-detach", 0, POPT_ARG_NONE, 0, OPT_DAEMON, 0, 0 },
+ {0,0,0,0, 0, 0, 0}
+};
+
+static void daemon_usage(enum logcode F)
+{
+ print_rsync_version(F);
+
+ rprintf(F,"\nUsage: rsync --daemon [OPTION]...\n");
+ rprintf(F," --address=ADDRESS bind to the specified address\n");
+ rprintf(F," --bwlimit=KBPS limit I/O bandwidth; KBytes per second\n");
+ 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");
+ rprintf(F," -v, --verbose increase verbosity\n");
+#ifdef INET6
+ rprintf(F," -4, --ipv4 prefer IPv4\n");
+ rprintf(F," -6, --ipv6 prefer IPv6\n");
+#endif
+ rprintf(F," -h, --help show this help screen\n");
+
+ rprintf(F,"\nIf you were not trying to invoke rsync as a daemon, avoid using any of the\n");
+ rprintf(F,"daemon-specific rsync options. See also the rsyncd.conf(5) man page.\n");
+}
+
+static struct poptOption long_daemon_options[] = {
+ /* longName, shortName, argInfo, argPtr, value, descrip, argDesc */
+ {"address", 0, POPT_ARG_STRING, &bind_address, 0, 0, 0 },
+ {"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
+ {"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
+ {"detach", 0, POPT_ARG_VAL, &no_detach, 0, 0, 0 },
+ {"no-detach", 0, POPT_ARG_VAL, &no_detach, 1, 0, 0 },
+ {"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 },