summaryrefslogtreecommitdiff
path: root/src/shared/output-mode.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/shared/output-mode.c')
-rw-r--r--src/shared/output-mode.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/shared/output-mode.c b/src/shared/output-mode.c
index bb33ba3d10..107b345538 100644
--- a/src/shared/output-mode.c
+++ b/src/shared/output-mode.c
@@ -3,6 +3,24 @@
#include "output-mode.h"
#include "string-table.h"
+JsonFormatFlags output_mode_to_json_format_flags(OutputMode m) {
+
+ switch (m) {
+
+ case OUTPUT_JSON_SSE:
+ return JSON_FORMAT_SSE;
+
+ case OUTPUT_JSON_SEQ:
+ return JSON_FORMAT_SEQ;
+
+ case OUTPUT_JSON_PRETTY:
+ return JSON_FORMAT_PRETTY;
+
+ default:
+ return JSON_FORMAT_NEWLINE;
+ }
+}
+
static const char *const output_mode_table[_OUTPUT_MODE_MAX] = {
[OUTPUT_SHORT] = "short",
[OUTPUT_SHORT_FULL] = "short-full",
@@ -16,6 +34,7 @@ static const char *const output_mode_table[_OUTPUT_MODE_MAX] = {
[OUTPUT_JSON] = "json",
[OUTPUT_JSON_PRETTY] = "json-pretty",
[OUTPUT_JSON_SSE] = "json-sse",
+ [OUTPUT_JSON_SEQ] = "json-seq",
[OUTPUT_CAT] = "cat",
[OUTPUT_WITH_UNIT] = "with-unit",
};