X-Git-Url: http://lists.indexdata.dk/cgi-bin?a=blobdiff_plain;f=src%2Fpazpar2.c;h=f1a24bc79d917a4f01156c07e862acbbe78dee05;hb=35714623860dd8ba20412c4cfbcf3a1a7ce89af8;hp=fcbbca2ff9aa66ee2ff1d9001d9eadce0b549799;hpb=457c6599b5dae1fb9e06b1c1a2f58a0922de5851;p=pazpar2-moved-to-github.git diff --git a/src/pazpar2.c b/src/pazpar2.c index fcbbca2..f1a24bc 100644 --- a/src/pazpar2.c +++ b/src/pazpar2.c @@ -1,5 +1,5 @@ /* This file is part of Pazpar2. - Copyright (C) 2006-2011 Index Data + Copyright (C) 2006-2012 Index Data Pazpar2 is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free @@ -22,6 +22,10 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #endif #ifdef WIN32 #include +#include +#endif +#if HAVE_UNISTD_H +#include #endif #include @@ -114,12 +118,12 @@ static int sc_main( yaz_log_init_prefix("pazpar2"); yaz_log_xml_errors(0, YLOG_WARN); - while ((ret = options("dDf:h:l:p:R:tu:v:VX", argv, argc, &arg)) != -2) + while ((ret = options("dDf:h:l:p:R:tu:v:Vw:X", argv, argc, &arg)) != -2) { switch (ret) { case 'd': - global_parameters.dump_records = 1; + global_parameters.dump_records++; break; case 'D': daemon = 1; @@ -152,6 +156,20 @@ static int sc_main( 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; @@ -169,6 +187,7 @@ static int sc_main( " -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"