summaryrefslogtreecommitdiff
path: root/src/journal
diff options
context:
space:
mode:
authorFrantisek Sumsal <frantisek@sumsal.cz>2022-03-14 18:16:15 +0100
committerFrantisek Sumsal <frantisek@sumsal.cz>2022-03-14 18:28:19 +0100
commitfaf20d4cca04cb9d08d098d4d9748e493648703b (patch)
tree6c9b2dafbdbc1fb6a126814feca86ae44eb10189 /src/journal
parent43c893e73e461dd2df6fddbbd1808bb178adf833 (diff)
downloadsystemd-faf20d4cca04cb9d08d098d4d9748e493648703b.tar.gz
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: 5a1355d848a0f6564a04c6d8268e72bc93d173de
Diffstat (limited to 'src/journal')
-rw-r--r--src/journal/journalctl.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/journal/journalctl.c b/src/journal/journalctl.c
index 4e3d17678e..e0951f9682 100644
--- a/src/journal/journalctl.c
+++ b/src/journal/journalctl.c
@@ -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':