+ int lineno = 0;
+
+ cmdline_conf = list_alloc((list_action_t)free_config);
+
+ while((r = getopt_long(argc, argv, "c:DLd::n:so:RU:", long_options, &option_index)) != EOF) {
+ switch(r) {
+ case 0: /* long option */
+ break;
+
+ case 'c': /* config file */
+ free(confbase);
+ confbase = xstrdup(optarg);
+ break;
+
+ case 'D': /* no detach */
+ do_detach = false;
+ break;
+
+ case 'L': /* no detach */
+#ifndef HAVE_MLOCKALL
+ logger(DEBUG_ALWAYS, LOG_ERR, "The %s option is not supported on this platform.", argv[optind - 1]);
+ goto exit_fail;
+#else
+ do_mlock = true;
+ break;
+#endif
+
+ case 'd': /* increase debug level */
+ if(!optarg && optind < argc && *argv[optind] != '-') {
+ optarg = argv[optind++];
+ }
+
+ if(optarg) {
+ debug_level = atoi(optarg);
+ } else {
+ debug_level++;
+ }
+
+ break;
+
+ case 'n': /* net name given */
+ free(netname);
+ netname = xstrdup(optarg);
+ break;
+
+ case 's': /* syslog */
+ use_logfile = false;
+ use_syslog = true;
+ break;
+
+ case 'o': /* option */
+ cfg = parse_config_line(optarg, NULL, ++lineno);
+
+ if(!cfg) {
+ goto exit_fail;
+ }
+
+ list_insert_tail(cmdline_conf, cfg);
+ break;
+
+#ifdef HAVE_MINGW
+
+ case 'R':
+ case 'U':
+ logger(DEBUG_ALWAYS, LOG_ERR, "The %s option is not supported on this platform.", argv[optind - 1]);
+ goto exit_fail;
+#else
+
+ case 'R': /* chroot to NETNAME dir */
+ do_chroot = true;
+ break;
+
+ case 'U': /* setuid to USER */
+ switchuser = optarg;
+ break;
+#endif
+
+ case 1: /* show help */
+ show_help = true;
+ break;