X-Git-Url: http://jsfdemo.indexdata.com/?a=blobdiff_plain;f=src%2Fpazpar2.c;h=0d441b20125fb8cd751c8ee869dd5ede5f9c55f9;hb=f1200fd1cab4fa57feacd43046997ce2d23edbd5;hp=84a325319e4c8caddddadcca7987ab0805c772cd;hpb=5d7214f79a8cd1b8c8e71453d670fb58eb180d34;p=pazpar2-moved-to-github.git diff --git a/src/pazpar2.c b/src/pazpar2.c index 84a3253..0d441b2 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 @@ -119,7 +123,7 @@ static int sc_main( switch (ret) { case 'd': - global_parameters.dump_records = 1; + global_parameters.dump_records++; break; case 'D': daemon = 1; @@ -139,6 +143,7 @@ static int sc_main( break; case 'R': record_fname = arg; + global_parameters.predictable_sessions = 1; break; case 't': test_mode = 1; @@ -151,8 +156,23 @@ 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; break; default: fprintf(stderr, "Usage: pazpar2\n" @@ -167,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"