From 51a3d287bb00f9dfdaefb2ee26b5ab08c8a9e024 Mon Sep 17 00:00:00 2001 From: P R <25353498+BigUstad@users.noreply.github.com> Date: Tue, 7 Jul 2020 20:52:01 -0700 Subject: [PATCH] mc ilm list cell alignment for text (#3291) --- cmd/ilm/tabular_info.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cmd/ilm/tabular_info.go b/cmd/ilm/tabular_info.go index 42bf8709..ca976366 100644 --- a/cmd/ilm/tabular_info.go +++ b/cmd/ilm/tabular_info.go @@ -22,9 +22,9 @@ import ( const ( // rule ID field column width in table output - idColumnWidth int = 12 + idColumnWidth int = 16 // rule prefix field column width in table output - prefixColumnWidth int = 10 + prefixColumnWidth int = 16 // StatusColumnWidth column width in table output statusColumnWidth int = 12 // ExpiryColumnWidth column width in table output @@ -302,7 +302,10 @@ func checkAddTableCell(rowArr *[]string, rowCheck map[string]int, cellInfo table if colIdx, ok := rowCheck[cellInfo.labelKey]; ok { if len(cellInfo.label)%2 != 0 && len(cellInfo.label) < cellInfo.columnWidth { cellInfo.label += " " + } else if len(cellInfo.label) > (cellInfo.columnWidth - 2) { // 2 dots to indicate text longer than column width + cellInfo.label = cellInfo.label[:(cellInfo.columnWidth-6)] + ".." } + (*rowArr)[colIdx] = getAlignedText(cellInfo.label, cellInfo.align, cellInfo.columnWidth) } }