From cc1ea7ef36868c0708741392c99fcd2f2c395131 Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Wed, 12 Jun 2019 19:27:37 +0200 Subject: monitor: Accept -j flag Make 'nft -j monitor' equal to 'nft monitor json' and change documentation to use only the first variant since that is more intuitive and also consistent with other commands. While being at it, drop references to XML from monitor section - it was never supported. Signed-off-by: Phil Sutter Signed-off-by: Pablo Neira Ayuso --- src/rule.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/rule.c') diff --git a/src/rule.c b/src/rule.c index 7eb89a00..8de5aa62 100644 --- a/src/rule.c +++ b/src/rule.c @@ -2435,6 +2435,9 @@ static int do_command_monitor(struct netlink_ctx *ctx, struct cmd *cmd) .debug_mask = ctx->nft->debug_mask, }; + if (nft_output_json(&ctx->nft->output)) + monhandler.format = NFTNL_OUTPUT_JSON; + monhandler.cache_needed = need_cache(cmd); if (monhandler.cache_needed) { struct rule *rule, *nrule; -- cgit v1.2.3