2019-11-19 14:31:44 +01:00
|
|
|
set jshn for convenience:
|
|
|
|
|
|
|
|
$ [ -n "$JSHN" ] && export PATH="$(dirname "$JSHN"):$PATH"
|
|
|
|
$ alias jshn="valgrind --quiet --leak-check=full jshn"
|
|
|
|
|
|
|
|
check usage:
|
|
|
|
|
|
|
|
$ jshn
|
2019-11-23 23:40:48 +01:00
|
|
|
Usage: jshn [-n] [-i] -r <message>|-R <file>|-o <file>|-p <prefix>|-w
|
2019-11-19 14:31:44 +01:00
|
|
|
[2]
|
|
|
|
|
|
|
|
test bad json:
|
|
|
|
|
|
|
|
$ jshn -r '[]'
|
|
|
|
Failed to parse message data
|
|
|
|
[1]
|
|
|
|
|
|
|
|
test good json:
|
|
|
|
|
|
|
|
$ jshn -r '{"foo": "bar", "baz": {"next": "meep"}}'
|
|
|
|
json_init;
|
|
|
|
json_add_string 'foo' 'bar';
|
|
|
|
json_add_object 'baz';
|
|
|
|
json_add_string 'next' 'meep';
|
|
|
|
json_close_object;
|