From ab75b3bd5dffe9425dfcfd36e76a60e8496bdd5d Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Wed, 21 Sep 2011 13:28:15 +0200 Subject: [PATCH] Refactor zoomsh to use YAZ options --- zoom/zoomsh.c | 57 +++++++++++++++++++++++++-------------------------------- 1 file changed, 25 insertions(+), 32 deletions(-) diff --git a/zoom/zoomsh.c b/zoom/zoomsh.c index 2126f30..c72eaa2 100644 --- a/zoom/zoomsh.c +++ b/zoom/zoomsh.c @@ -14,6 +14,7 @@ #include #include #include +#include #if HAVE_READLINE_READLINE_H #include @@ -724,8 +725,8 @@ void shell(ZOOM_connection *c, ZOOM_resultset *r, static void zoomsh(int argc, char **argv) { - ZOOM_options options = ZOOM_options_create(); - int i, res; + ZOOM_options zoom_options = ZOOM_options_create(); + int i, res = 1; ZOOM_connection z39_con[MAX_CON]; ZOOM_resultset z39_res[MAX_CON]; @@ -734,21 +735,31 @@ static void zoomsh(int argc, char **argv) z39_con[i] = 0; z39_res[i] = 0; } - - for (i = 0; i 2 && !strcmp(argv[1], "-v")) - { - maskstr = argv[2]; - argv += 2; - argc -= 2; - } - else if (argc > 1 && !strncmp(argv[1], "-v", 2)) - { - maskstr = argv[1]+2; - argv++; - argc--; - } - if (maskstr) - { - int mask = yaz_log_mask_str(maskstr); - yaz_log_init_level(mask); - } zoomsh(argc, argv); exit(0); } -- 1.7.10.4