From dc4920b411962e9cbe20939ac78a6577f1e1d435 Mon Sep 17 00:00:00 2001 From: Sebastian Hammer Date: Mon, 4 Dec 2006 03:31:24 +0000 Subject: [PATCH] Usage --- pazpar2.c | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/pazpar2.c b/pazpar2.c index a1d939a..08c5da6 100644 --- a/pazpar2.c +++ b/pazpar2.c @@ -1,4 +1,4 @@ -/* $Id: pazpar2.c,v 1.9 2006-12-04 02:27:02 quinn Exp $ */; +/* $Id: pazpar2.c,v 1.10 2006-12-04 03:31:24 quinn Exp $ */; #include #include @@ -1307,6 +1307,7 @@ int main(int argc, char **argv) { int ret; char *arg; + int setport = 0; if (signal(SIGPIPE, SIG_IGN) < 0) yaz_log(YLOG_WARN|YLOG_ERRNO, "signal"); @@ -1316,16 +1317,16 @@ int main(int argc, char **argv) while ((ret = options("c:h:p:C:s:", argv, argc, &arg)) != -2) { switch (ret) { - case 0: - break; case 'c': command_init(atoi(arg)); + setport++; break; - case 'C': - global_parameters.ccl_filter = load_cclfile(arg); - break; case 'h': http_init(atoi(arg)); + setport++; + break; + case 'C': + global_parameters.ccl_filter = load_cclfile(arg); break; case 'p': http_set_proxyaddr(arg); @@ -1334,11 +1335,22 @@ int main(int argc, char **argv) load_simpletargets(arg); break; default: - fprintf(stderr, "Usage: pazpar2 -d comport"); + fprintf(stderr, "Usage: pazpar2\n" + " -h httpport (REST)\n" + " -c cmdport (telnet-style)\n" + " -C cclconfig\n" + " -s simpletargetfile\n" + " -p hostname[:portno] (HTTP proxy)\n"); exit(1); } } + if (!setport) + { + fprintf(stderr, "Set command port with -h or -c\n"); + exit(1); + } + global_parameters.ccl_filter = load_cclfile("default.bib"); global_parameters.yaz_marc = yaz_marc_create(); yaz_marc_subfield_str(global_parameters.yaz_marc, "\t"); -- 1.7.10.4