X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=util%2Fjson-parse.c;h=ea32ccd3000ec0a3187d37833130b327bb9da425;hp=ce1da8b50f122066ebb5f1d62ed2d9d7d320e556;hb=0d6f3ee9720647761ff74414a46828c0b9711ac0;hpb=14a92b63a016b6cc96c857cad8283efda91ea867 diff --git a/util/json-parse.c b/util/json-parse.c index ce1da8b..ea32ccd 100644 --- a/util/json-parse.c +++ b/util/json-parse.c @@ -1,7 +1,10 @@ /* This file is part of the YAZ toolkit. - * Copyright (C) 1995-2010 Index Data + * Copyright (C) Index Data * See the file LICENSE for details. */ +#if HAVE_CONFIG_H +#include +#endif #include #include @@ -52,7 +55,7 @@ int main(int argc, char **argv) switch (ret) { case 'p': - print = 1; + print++; break; default: usage(argv[0]); @@ -64,7 +67,10 @@ int main(int argc, char **argv) if (print) { WRBUF result = wrbuf_alloc(); - json_write_wrbuf(n, result); + if (print > 1) + json_write_wrbuf_pretty(n, result); + else + json_write_wrbuf(n, result); puts(wrbuf_cstr(result)); wrbuf_destroy(result); }