From: Nick Rosbrook Date: Tue, 22 Oct 2024 16:09:55 +0000 (-0400) Subject: varlinkctl: set SD_JSON_FORMAT_FLUSH when --more is set X-Git-Tag: v257-rc1~165^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F34860%2Fhead;p=thirdparty%2Fsystemd.git varlinkctl: set SD_JSON_FORMAT_FLUSH when --more is set This makes it possible to process continuous replies with jq etc. --- diff --git a/src/varlinkctl/varlinkctl.c b/src/varlinkctl/varlinkctl.c index f204b0f3c94..b6c6c0da420 100644 --- a/src/varlinkctl/varlinkctl.c +++ b/src/varlinkctl/varlinkctl.c @@ -194,9 +194,9 @@ static int parse_argv(int argc, char *argv[]) { assert_not_reached(); } - /* If more than one reply is expected, imply JSON-SEQ output */ + /* If more than one reply is expected, imply JSON-SEQ output, and set SD_JSON_FORMAT_FLUSH */ if (FLAGS_SET(arg_method_flags, SD_VARLINK_METHOD_MORE)) - arg_json_format_flags |= SD_JSON_FORMAT_SEQ; + arg_json_format_flags |= SD_JSON_FORMAT_SEQ|SD_JSON_FORMAT_FLUSH; strv_sort_uniq(arg_graceful);