From: Adam Dickmeiss Date: Wed, 21 Sep 2011 11:28:15 +0000 (+0200) Subject: Refactor zoomsh to use YAZ options X-Git-Tag: v4.2.16~5 X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=commitdiff_plain;h=ab75b3bd5dffe9425dfcfd36e76a60e8496bdd5d Refactor zoomsh to use YAZ options --- 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); }