udevadm: automatically anable JSON-SEQ in case JSON is used for "udevadm info -a"

We are going to output a series of JSON objects, hence let's
automatically enable JSON-SEQ output mode, as we usually do.

"jq --seq" supports this natively, hence this should not really restrict
us.

Follow-up for: 67ea8a4c0e
This commit is contained in:
Lennart Poettering
2024-10-29 22:39:59 +09:00
committed by Yu Watanabe
parent 7aea1c9e80
commit ebc64de22f
3 changed files with 9 additions and 2 deletions
+2
View File
@@ -274,6 +274,8 @@ static int print_device_chain_in_json(sd_device *device) {
assert(device);
arg_json_format_flags |=SD_JSON_FORMAT_SEQ;
r = print_all_attributes_in_json(device, /* is_parent = */ false);
if (r < 0)
return r;