X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=util%2Fyaz-url.c;h=7a78e6755818d14519174fa73b3ece9e7dfbd948;hp=03cb63e819d9fa06bd17c0aa7716f7771e1afa92;hb=ce627148dbba2878565b8d9da33f6b25f33da4bd;hpb=765377f7bf8fc6f1c9089ec5a1e5e906dc80e930 diff --git a/util/yaz-url.c b/util/yaz-url.c index 03cb63e..7a78e67 100644 --- a/util/yaz-url.c +++ b/util/yaz-url.c @@ -1,5 +1,5 @@ /* This file is part of the YAZ toolkit. - * Copyright (C) 1995-2012 Index Data + * Copyright (C) Index Data * See the file LICENSE for details. */ @@ -21,7 +21,9 @@ static void usage(void) printf(" -m method Sets HTTP method\n"); printf(" -O fname Writes HTTP content to file\n"); printf(" -p fname POSTs file at following url\n"); + printf(" -R num Set maximum number of HTTP redirects\n"); printf(" -u user/password Sets Basic HTTP auth\n"); + printf(" -v Verbose\n"); printf(" -x proxy Sets HTTP proxy\n"); exit(1); } @@ -72,7 +74,7 @@ int main(int argc, char **argv) int no_urls = 0; const char *outfname = 0; - while ((ret = options("hH:m:O:p:u:x:", argv, argc, &arg)) + while ((ret = options("h{help}H:m:O:p:R{max-redirs}:u:vx:", argv, argc, &arg)) != YAZ_OPTIONS_EOF) { switch (ret) @@ -109,6 +111,9 @@ int main(int argc, char **argv) post_buf = get_file(arg, &post_len); method = "POST"; break; + case 'R': + yaz_url_set_max_redirects(p, atoi(arg)); + break; case 'u': if (strchr(arg, '/')) { @@ -123,6 +128,9 @@ int main(int argc, char **argv) else z_HTTP_header_add_basic_auth(odr, &http_headers, arg, 0); break; + case 'v': + yaz_url_set_verbose(p, 1); + break; case 'x': yaz_url_set_proxy(p, arg); break;