mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-02 01:18:26 +03:00
config: recognize 'json_std' for report/output_format config setting
This commit is contained in:
parent
73ec3c954b
commit
6cba28a335
@ -1806,7 +1806,14 @@ cfg(report_output_format_CFG, "output_format", report_CFG_SECTION, CFG_PROFILABL
|
|||||||
" one report per command, each report is prefixed with report's\n"
|
" one report per command, each report is prefixed with report's\n"
|
||||||
" name for identification.\n"
|
" name for identification.\n"
|
||||||
" json\n"
|
" json\n"
|
||||||
" JSON format.\n")
|
" JSON format.\n"
|
||||||
|
" json_std\n"
|
||||||
|
" JSON format that is more compliant with JSON standard.\n"
|
||||||
|
" Compared to original \"json\" format:\n"
|
||||||
|
" - it does not use double quotes around numeric values,\n"
|
||||||
|
" - it uses 'null' for undefined numeric values,\n"
|
||||||
|
" - it prints string list as proper JSON array of strings instead of a single string."
|
||||||
|
"\n")
|
||||||
|
|
||||||
cfg(report_compact_output_CFG, "compact_output", report_CFG_SECTION, CFG_PROFILABLE | CFG_DEFAULT_COMMENTED, CFG_TYPE_BOOL, DEFAULT_REP_COMPACT_OUTPUT, vsn(2, 2, 115), NULL, 0, NULL,
|
cfg(report_compact_output_CFG, "compact_output", report_CFG_SECTION, CFG_PROFILABLE | CFG_DEFAULT_COMMENTED, CFG_TYPE_BOOL, DEFAULT_REP_COMPACT_OUTPUT, vsn(2, 2, 115), NULL, 0, NULL,
|
||||||
"Do not print empty values for all report fields.\n"
|
"Do not print empty values for all report fields.\n"
|
||||||
|
@ -1455,6 +1455,7 @@ int devtypes(struct cmd_context *cmd, int argc, char **argv)
|
|||||||
|
|
||||||
#define REPORT_FORMAT_NAME_BASIC "basic"
|
#define REPORT_FORMAT_NAME_BASIC "basic"
|
||||||
#define REPORT_FORMAT_NAME_JSON "json"
|
#define REPORT_FORMAT_NAME_JSON "json"
|
||||||
|
#define REPORT_FORMAT_NAME_JSON_STD "json_std"
|
||||||
|
|
||||||
int report_format_init(struct cmd_context *cmd)
|
int report_format_init(struct cmd_context *cmd)
|
||||||
{
|
{
|
||||||
@ -1475,11 +1476,14 @@ int report_format_init(struct cmd_context *cmd)
|
|||||||
: DM_REPORT_GROUP_SINGLE;
|
: DM_REPORT_GROUP_SINGLE;
|
||||||
} else if (!strcmp(format_str, REPORT_FORMAT_NAME_JSON)) {
|
} else if (!strcmp(format_str, REPORT_FORMAT_NAME_JSON)) {
|
||||||
args.report_group_type = DM_REPORT_GROUP_JSON;
|
args.report_group_type = DM_REPORT_GROUP_JSON;
|
||||||
|
} else if (!strcmp(format_str, REPORT_FORMAT_NAME_JSON_STD)) {
|
||||||
|
args.report_group_type = DM_REPORT_GROUP_JSON_STD;
|
||||||
} else {
|
} else {
|
||||||
log_error("%s: unknown report format.", format_str);
|
log_error("%s: unknown report format.", format_str);
|
||||||
log_error("Supported report formats: %s, %s.",
|
log_error("Supported report formats: %s, %s, %s.",
|
||||||
REPORT_FORMAT_NAME_BASIC,
|
REPORT_FORMAT_NAME_BASIC,
|
||||||
REPORT_FORMAT_NAME_JSON);
|
REPORT_FORMAT_NAME_JSON,
|
||||||
|
REPORT_FORMAT_NAME_JSON_STD);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user