X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=zoom%2Fzoomsh.c;h=d61919d8ceb6956aee8a94285ee018345a333a9d;hp=627e2163c4f86c936d30ac4ebebd192d76e81835;hb=a2691350ad223dd62d441fab573cd3cb241a14b3;hpb=70c49c4cc7bd32eeaed7b88a82f43d50ee28ff20 diff --git a/zoom/zoomsh.c b/zoom/zoomsh.c index 627e216..d61919d 100644 --- a/zoom/zoomsh.c +++ b/zoom/zoomsh.c @@ -1,5 +1,5 @@ /* - * $Id: zoomsh.c,v 1.8 2002-02-20 14:40:42 adam Exp $ + * $Id: zoomsh.c,v 1.16 2003-02-23 15:24:27 adam Exp $ * * ZOOM-C Shell */ @@ -18,6 +18,7 @@ #include +#include #include #define MAX_CON 100 @@ -76,12 +77,25 @@ static void cmd_set (ZOOM_connection *c, ZOOM_resultset *r, return ; } if (!next_token_copy (args, val, sizeof(val))) + ZOOM_options_set(options, key, 0); + else + ZOOM_options_set(options, key, val); +} + +static void cmd_get (ZOOM_connection *c, ZOOM_resultset *r, + ZOOM_options options, + const char **args) +{ + char key[40]; + if (!next_token_copy (args, key, sizeof(key))) { - const char *val = ZOOM_options_get(options, key); - printf ("%s = %s\n", key, val ? val : ""); + printf ("missing argument for get\n"); } else - ZOOM_options_set(options, key, val); + { + const char *val = ZOOM_options_get(options, key); + printf ("%s = %s\n", key, val ? val : ""); + } } static void cmd_close (ZOOM_connection *c, ZOOM_resultset *r, @@ -155,14 +169,14 @@ static void cmd_show (ZOOM_connection *c, ZOOM_resultset *r, for (i = 0; i []\n"); printf ("quit\n"); printf ("close \n"); - printf ("set