Solves Bug 1388 - Combining --terse with --json has no effect Signed-off-by: Gopal Yadav <gopunop@xxxxxxxxx> --- src/json.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/json.c b/src/json.c index a9f5000f..702cf6eb 100644 --- a/src/json.c +++ b/src/json.c @@ -147,7 +147,8 @@ static json_t *set_print_json(struct output_ctx *octx, const struct set *set) list_for_each_entry(i, &set->init->expressions, list) json_array_append_new(array, expr_print_json(i, octx)); - json_object_set_new(root, "elem", array); + if (!(octx->flags & NFT_CTX_OUTPUT_TERSE)) + json_object_set_new(root, "elem", array); } return json_pack("{s:o}", type, root); -- 2.20.1