X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=zoom%2Fzoomsh.c;h=bf35f6a9bf40de8b3108f3a9c89aa6fde88a8888;hb=63d3984ef11179af51a79d202dca15b70403099b;hp=24746d26a5c033c9f5c7ce5d45ec83897b91ecd3;hpb=13671e7cc0f3dd4e4b02f94d64a50778c5696ba6;p=yaz-moved-to-github.git diff --git a/zoom/zoomsh.c b/zoom/zoomsh.c index 24746d2..bf35f6a 100644 --- a/zoom/zoomsh.c +++ b/zoom/zoomsh.c @@ -1,5 +1,5 @@ /* - * $Id: zoomsh.c,v 1.7 2001-11-18 21:14:23 adam Exp $ + * $Id: zoomsh.c,v 1.12 2003-01-06 08:20:28 adam Exp $ * * ZOOM-C Shell */ @@ -76,12 +76,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, @@ -129,7 +142,7 @@ static void display_records (ZOOM_connection c, printf ("%d %s %s\n", pos+1, (db ? db : "unknown"), syntax); if (render) fwrite (render, 1, len, stdout); - putchar ('\n'); + printf ("\n"); } } } @@ -155,14 +168,14 @@ static void cmd_show (ZOOM_connection *c, ZOOM_resultset *r, for (i = 0; i []\n"); printf ("quit\n"); printf ("close \n"); - printf ("set