]>
git.ipfire.org Git - thirdparty/systemd.git/blob - src/shared/output-mode.c
1 /* SPDX-License-Identifier: LGPL-2.1+ */
3 #include "output-mode.h"
4 #include "string-table.h"
6 JsonFormatFlags
output_mode_to_json_format_flags(OutputMode m
) {
11 return JSON_FORMAT_SSE
;
14 return JSON_FORMAT_SEQ
;
16 case OUTPUT_JSON_PRETTY
:
17 return JSON_FORMAT_PRETTY
;
20 return JSON_FORMAT_NEWLINE
;
24 static const char *const output_mode_table
[_OUTPUT_MODE_MAX
] = {
25 [OUTPUT_SHORT
] = "short",
26 [OUTPUT_SHORT_FULL
] = "short-full",
27 [OUTPUT_SHORT_ISO
] = "short-iso",
28 [OUTPUT_SHORT_ISO_PRECISE
] = "short-iso-precise",
29 [OUTPUT_SHORT_PRECISE
] = "short-precise",
30 [OUTPUT_SHORT_MONOTONIC
] = "short-monotonic",
31 [OUTPUT_SHORT_UNIX
] = "short-unix",
32 [OUTPUT_VERBOSE
] = "verbose",
33 [OUTPUT_EXPORT
] = "export",
34 [OUTPUT_JSON
] = "json",
35 [OUTPUT_JSON_PRETTY
] = "json-pretty",
36 [OUTPUT_JSON_SSE
] = "json-sse",
37 [OUTPUT_JSON_SEQ
] = "json-seq",
39 [OUTPUT_WITH_UNIT
] = "with-unit",
42 DEFINE_STRING_TABLE_LOOKUP(output_mode
, OutputMode
);