From 9b685bd3c014fd6b68c8a3018290aaa8c6a1d518 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Tue, 24 Sep 2013 17:55:20 +0200 Subject: [PATCH] cql2pqf: allow PQF queries from stdin --- util/cql2pqf.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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(); -- 1.7.10.4