From: Adam Dickmeiss Date: Thu, 11 Aug 2011 06:21:08 +0000 (+0200) Subject: yaz-url: display usage if no ULRs are given X-Git-Tag: v4.2.8~9 X-Git-Url: http://jsfdemo.indexdata.com/cgi-bin?a=commitdiff_plain;h=2e45e866cd91bf96707fdc0a278e8481773c4c86;p=yaz-moved-to-github.git yaz-url: display usage if no ULRs are given --- 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); }