From: Adam Dickmeiss Date: Tue, 24 Sep 2013 15:55:20 +0000 (+0200) Subject: cql2pqf: allow PQF queries from stdin X-Git-Tag: v4.2.69~13 X-Git-Url: http://lists.indexdata.dk/?a=commitdiff_plain;h=9b685bd3c014fd6b68c8a3018290aaa8c6a1d518;p=yaz-moved-to-github.git cql2pqf: allow PQF queries from stdin --- diff --git a/util/cql2pqf.c b/util/cql2pqf.c index 13c62b0..1ea16e6 100644 --- a/util/cql2pqf.c +++ b/util/cql2pqf.c @@ -73,9 +73,14 @@ int main(int argc, char **argv) if (reverse) { + char buf[1024]; + if (!query) - usage(); - else + { + if (fgets(buf, sizeof buf, stdin)) + query = buf; + } + if (query) { ODR odr = odr_createmem(ODR_ENCODE); YAZ_PQF_Parser pp = yaz_pqf_create();