]>
Commit | Line | Data |
---|---|---|
db9ecf05 | 1 | /* SPDX-License-Identifier: LGPL-2.1-or-later */ |
766cd081 LP |
2 | |
3 | #include "output-mode.h" | |
4 | #include "string-table.h" | |
5 | ||
9e964bb8 LP |
6 | JsonFormatFlags output_mode_to_json_format_flags(OutputMode m) { |
7 | ||
8 | switch (m) { | |
9 | ||
10 | case OUTPUT_JSON_SSE: | |
11 | return JSON_FORMAT_SSE; | |
12 | ||
13 | case OUTPUT_JSON_SEQ: | |
14 | return JSON_FORMAT_SEQ; | |
15 | ||
16 | case OUTPUT_JSON_PRETTY: | |
17 | return JSON_FORMAT_PRETTY; | |
18 | ||
19 | default: | |
20 | return JSON_FORMAT_NEWLINE; | |
21 | } | |
22 | } | |
23 | ||
766cd081 LP |
24 | static const char *const output_mode_table[_OUTPUT_MODE_MAX] = { |
25 | [OUTPUT_SHORT] = "short", | |
29a753df | 26 | [OUTPUT_SHORT_FULL] = "short-full", |
766cd081 | 27 | [OUTPUT_SHORT_ISO] = "short-iso", |
7e563bfc | 28 | [OUTPUT_SHORT_ISO_PRECISE] = "short-iso-precise", |
766cd081 LP |
29 | [OUTPUT_SHORT_PRECISE] = "short-precise", |
30 | [OUTPUT_SHORT_MONOTONIC] = "short-monotonic", | |
893bcd3d | 31 | [OUTPUT_SHORT_DELTA] = "short-delta", |
bb321ed9 | 32 | [OUTPUT_SHORT_UNIX] = "short-unix", |
766cd081 LP |
33 | [OUTPUT_VERBOSE] = "verbose", |
34 | [OUTPUT_EXPORT] = "export", | |
35 | [OUTPUT_JSON] = "json", | |
36 | [OUTPUT_JSON_PRETTY] = "json-pretty", | |
37 | [OUTPUT_JSON_SSE] = "json-sse", | |
8e044443 | 38 | [OUTPUT_JSON_SEQ] = "json-seq", |
49805b3d LB |
39 | [OUTPUT_CAT] = "cat", |
40 | [OUTPUT_WITH_UNIT] = "with-unit", | |
766cd081 LP |
41 | }; |
42 | ||
43 | DEFINE_STRING_TABLE_LOOKUP(output_mode, OutputMode); |