From 2e45e866cd91bf96707fdc0a278e8481773c4c86 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Thu, 11 Aug 2011 08:21:08 +0200 Subject: [PATCH] yaz-url: display usage if no ULRs are given --- util/yaz-url.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/util/yaz-url.c b/util/yaz-url.c index bdc912c..b59b176 100644 --- a/util/yaz-url.c +++ b/util/yaz-url.c @@ -58,6 +58,7 @@ int main(int argc, char **argv) Z_HTTP_Header *http_headers = 0; ODR odr = odr_createmem(ODR_ENCODE); int exit_code = 0; + int no_urls = 0; while ((ret = options("hH:p:u:x:", argv, argc, &arg)) != YAZ_OPTIONS_EOF) @@ -115,6 +116,7 @@ int main(int argc, char **argv) fwrite(http_response->content_buf, 1, http_response->content_len, stdout); } + no_urls++; break; default: usage(); @@ -122,6 +124,8 @@ int main(int argc, char **argv) } yaz_url_destroy(p); odr_destroy(odr); + if (no_urls == 0) + usage(); exit(exit_code); } -- 1.7.10.4