journal: reset previously set JSON flags

Make sure we reset the JSON format flags if the format option is used
multiple times, e.g. `journalctl -o json-format -o export`.

Pointed out in: https://github.com/systemd/systemd/pull/22721#discussion_r826018985
Follow-up for: 5a1355d848
This commit is contained in:
Frantisek Sumsal
2022-03-14 18:28:19 +01:00
parent 43c893e73e
commit faf20d4cca
+3
View File
@@ -581,6 +581,9 @@ static int parse_argv(int argc, char *argv[]) {
if (OUTPUT_MODE_IS_JSON(arg_output))
arg_json_format_flags = output_mode_to_json_format_flags(arg_output) | JSON_FORMAT_COLOR_AUTO;
else
arg_json_format_flags = JSON_FORMAT_OFF;
break;
case 'l':