- switch (ret) {
- case 'f':
- if (!read_config(arg))
- exit(1);
- break;
- case 'h':
- strcpy(global_parameters.listener_override, arg);
- break;
- case 'p':
- strcpy(global_parameters.proxy_override, arg);
- break;
- case 'z':
- strcpy(global_parameters.zproxy_override, arg);
- break;
- case 't':
- strcpy(global_parameters.settings_path_override, arg);
- break;
- case 's':
- load_simpletargets(arg);
- break;
- case 'd':
- global_parameters.dump_records = 1;
- break;
- default:
- fprintf(stderr, "Usage: pazpar2\n"
- " -f configfile\n"
- " -h [host:]port (REST protocol listener)\n"
- " -C cclconfig\n"
- " -s simpletargetfile\n"
- " -p hostname[:portno] (HTTP proxy)\n"
- " -z hostname[:portno] (Z39.50 proxy)\n"
- " -d (show internal records)\n");
- exit(1);
+ switch (ret)
+ {
+ case 'd':
+ global_parameters.dump_records = 1;
+ break;
+ case 'D':
+ daemon = 1;
+ break;
+ case 'f':
+ config_fname = arg;
+ break;
+ case 'h':
+ listener_override = arg;
+ break;
+ case 'l':
+ yaz_log_init_file(arg);
+ log_file_in_use = 1;
+ break;
+ case 'p':
+ pidfile = arg;
+ break;
+ case 'R':
+ record_fname = arg;
+ global_parameters.predictable_sessions = 1;
+ break;
+ case 't':
+ test_mode = 1;
+ break;
+ case 'u':
+ uid = arg;
+ break;
+ case 'v':
+ yaz_log_init_level(yaz_log_mask_str(arg));
+ break;
+ case 'V':
+ show_version();
+ break;
+ case 'w':
+ if (
+#ifdef WIN32
+ _chdir
+#else
+ chdir
+#endif
+ (arg))
+ {
+ yaz_log(YLOG_FATAL|YLOG_ERRNO, "chdir %s", arg);
+ return 1;
+ }
+ break;
+ case 'X':
+ global_parameters.debug_mode++;
+ global_parameters.predictable_sessions = 1;
+ break;
+ default:
+ fprintf(stderr, "Usage: pazpar2\n"
+ " -d Show internal records\n"
+ " -D Daemon mode (background)\n"
+ " -f configfile Configuration\n"
+ " -h [host:]port Listener port\n"
+ " -l file Log to file\n"
+ " -p pidfile PID file\n"
+ " -R recfile HTTP recording file\n"
+ " -t Test configuration\n"
+ " -u uid Change user to uid\n"
+ " -V Show version\n"
+ " -v level Set log level\n"
+ " -w dir Working directory\n"
+ " -X Debug mode\n"
+#ifdef WIN32
+ " -install Install windows service\n"
+ " -remove Remove windows service\n"
+#endif
+ );
+ return 1;