summaryrefslogtreecommitdiffstats
path: root/libdm/libdm-report.c
diff options
context:
space:
mode:
authorAlasdair Kergon <agk@redhat.com>2007-01-23 19:18:52 +0000
committerAlasdair Kergon <agk@redhat.com>2007-01-23 19:18:52 +0000
commit85feafd996ab039f6eecf9177aa61a6a3c04fc65 (patch)
tree2f349100373fc23878f31cf3ed26a1e942ea911f /libdm/libdm-report.c
parent3329c69865fe8d1ea7cacebe4e765bd55dcea4b7 (diff)
downloadlvm2-85feafd996ab039f6eecf9177aa61a6a3c04fc65.tar.gz
lvm2-85feafd996ab039f6eecf9177aa61a6a3c04fc65.tar.xz
lvm2-85feafd996ab039f6eecf9177aa61a6a3c04fc65.zip
Add descriptions to reporting field definitions.
Diffstat (limited to 'libdm/libdm-report.c')
-rw-r--r--libdm/libdm-report.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/libdm/libdm-report.c b/libdm/libdm-report.c
index e8add5f1..627c5124 100644
--- a/libdm/libdm-report.c
+++ b/libdm/libdm-report.c
@@ -248,6 +248,11 @@ static void _display_fields(struct dm_report *rh)
uint32_t f;
const struct dm_report_object_type *type;
const char *desc, *last_desc = "";
+ size_t id_len = 0;
+
+ for (f = 0; rh->fields[f].report_fn; f++)
+ if (strlen(rh->fields[f].id) > id_len)
+ id_len = strlen(rh->fields[f].id);
for (f = 0; rh->fields[f].report_fn; f++) {
if ((type = _find_type(rh, rh->fields[f].type)) && type->desc)
@@ -260,7 +265,7 @@ static void _display_fields(struct dm_report *rh)
log_print("%s Fields", desc);
}
- log_print("- %s", rh->fields[f].id);
+ log_print("- %-*s: %s", (int) id_len, rh->fields[f].id, rh->fields[f].desc);
last_desc = desc;
}
}