From c5eea0ab9c0ce31b172eac948c32a6cea5d0965f Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Tue, 4 Dec 2018 10:17:54 -0800 Subject: Fix 'zpool list -v' alignment The verbose output of 'zpool list' was not correctly aligned due to differences in the vdev name lengths. Minimally update the code the correct the alignment using the same strategy employed by 'zpool status'. Missing dashes were added for the empty defaults columns, and the vdev state is now printed for all vdevs. Reviewed-by: Tom Caputi Reviewed-by: Tony Hutter Signed-off-by: Brian Behlendorf Closes #7308 Closes #8147 --- module/zcommon/zprop_common.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'module/zcommon') diff --git a/module/zcommon/zprop_common.c b/module/zcommon/zprop_common.c index 4d856cec1..8416983fd 100644 --- a/module/zcommon/zprop_common.c +++ b/module/zcommon/zprop_common.c @@ -437,6 +437,12 @@ zprop_width(int prop, boolean_t *fixed, zfs_type_t type) */ if (prop == ZFS_PROP_CREATION) *fixed = B_FALSE; + /* + * 'health' is handled specially because it's a number + * internally, but displayed as a fixed 8 character string. + */ + if (prop == ZPOOL_PROP_HEALTH) + ret = 8; break; case PROP_TYPE_INDEX: idx = prop_tbl[prop].pd_table; -- cgit v1.2.3