From f7e95b936f1d53b1f19a93d7cdca0821d7e09f93 Mon Sep 17 00:00:00 2001 From: Conrad Irwin Date: Sun, 17 Jul 2011 14:47:37 -0700 Subject: Allow testing yajl_gen_escape_solidus --- reformatter/json_reformat.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/reformatter/json_reformat.c b/reformatter/json_reformat.c index c5b88f0..ce77c11 100644 --- a/reformatter/json_reformat.c +++ b/reformatter/json_reformat.c @@ -99,6 +99,7 @@ usage(const char * progname) "usage: json_reformat [options]\n" " -m minimize json rather than beautify (default)\n" " -u allow invalid UTF8 inside strings during parsing\n", + " -e escape any forward slashes (for embedding in HTML)\n", progname); exit(1); @@ -136,6 +137,9 @@ main(int argc, char ** argv) case 'u': yajl_config(hand, yajl_dont_validate_strings, 1); break; + case 'e': + yajl_gen_config(g, yajl_gen_escape_solidus, 1); + break; default: fprintf(stderr, "unrecognized option: '%c'\n\n", argv[a][i]); -- cgit v1.2.1