libubox/tests/cram/test_jshn.t
Petr Štetiar 26586dae43 jshn: fix missing usage for -p and -o arguments
Add missing usage hints for -p and -o arguments.

Fixes: e16fa068a5 ("jshn: add support for namespaces")
Fixes: eb30a03048 ("libubox, jshn: add option to write output to a file")
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2019-11-24 13:26:58 +01:00

25 lines
513 B
Perl

set jshn for convenience:
$ [ -n "$JSHN" ] && export PATH="$(dirname "$JSHN"):$PATH"
$ alias jshn="valgrind --quiet --leak-check=full jshn"
check usage:
$ jshn
Usage: jshn [-n] [-i] -r <message>|-R <file>|-o <file>|-p <prefix>|-w
[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;