summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Rajnoha <prajnoha@redhat.com>2022-08-04 16:50:01 +0200
committerPeter Rajnoha <prajnoha@redhat.com>2022-08-11 11:10:11 +0200
commitaa7cec61edae849c5fab7e1319684b43fdc439de (patch)
tree871bf2c68ef09dc9aa8b583a0e409046c38a0112
parent6cba28a335284de9dd68d84b4dd660f6e744eba5 (diff)
downloadlvm2-aa7cec61edae849c5fab7e1319684b43fdc439de.tar.gz
args: recognize 'json_std' for --reportformat cmd line arg
-rw-r--r--tools/args.h4
-rw-r--r--tools/lvmcmdline.c3
-rw-r--r--tools/vals.h2
3 files changed, 6 insertions, 3 deletions
diff --git a/tools/args.h b/tools/args.h
index 2f94d4535..9229b8764 100644
--- a/tools/args.h
+++ b/tools/args.h
@@ -677,7 +677,9 @@ arg(reportformat_ARG, '\0', "reportformat", reportformat_VAL, 0, 0,
"\\fBbasic\\fP is the original format with columns and rows.\n"
"If there is more than one report per command, each report is prefixed\n"
"with the report name for identification. \\fBjson\\fP produces report\n"
- "output in JSON format. See \\fBlvmreport\\fP(7) for more information.\n")
+ "output in JSON format. \\fBjson_std\\fP produces report output in\n"
+ "JSON format which is more compliant with JSON standard.\n"
+ "See \\fBlvmreport\\fP(7) for more information.\n")
arg(restorefile_ARG, '\0', "restorefile", string_VAL, 0, 0,
"In conjunction with --uuid, this reads the file (produced by\n"
diff --git a/tools/lvmcmdline.c b/tools/lvmcmdline.c
index b052d698f..4fb21074f 100644
--- a/tools/lvmcmdline.c
+++ b/tools/lvmcmdline.c
@@ -1058,7 +1058,8 @@ int syncaction_arg(struct cmd_context *cmd, struct arg_values *av)
int reportformat_arg(struct cmd_context *cmd, struct arg_values *av)
{
if (!strcmp(av->value, "basic") ||
- !strcmp(av->value, "json"))
+ !strcmp(av->value, "json") ||
+ !strcmp(av->value, "json_std"))
return 1;
return 0;
}
diff --git a/tools/vals.h b/tools/vals.h
index addbea2f2..590755a1e 100644
--- a/tools/vals.h
+++ b/tools/vals.h
@@ -138,7 +138,7 @@ val(metadatacopies_VAL, metadatacopies_arg, "unused", "unused")
val(polloperation_VAL, polloperation_arg, "PollOp", "pvmove|convert|merge|merge_thin")
val(writemostly_VAL, writemostly_arg, "WriteMostlyPV", "PV[:t|n|y]")
val(syncaction_VAL, syncaction_arg, "SyncAction", "check|repair")
-val(reportformat_VAL, reportformat_arg, "ReportFmt", "basic|json")
+val(reportformat_VAL, reportformat_arg, "ReportFmt", "basic|json|json_std")
val(configreport_VAL, configreport_arg, "ConfigReport", "log|vg|lv|pv|pvseg|seg")
val(configtype_VAL, configtype_arg, "ConfigType", "current|default|diff|full|list|missing|new|profilable|profilable-command|profilable-metadata")
val(repairtype_VAL, repairtype_arg, "RepairType", "pv_header|metadata|label_header")