From d8ec3256adf79c62c0b82d945c34713bd09d9b22 Mon Sep 17 00:00:00 2001 From: sychen Date: Fri, 4 Mar 2022 09:38:55 +0800 Subject: [PATCH] [KYUUBI #2006] Improve the readability of ServiceControl list/get operations ### _Why are the changes needed?_ When the get server and list server commands are displayed, when the namespace exceeds the minimum width, it will be glued to the hostname. Add a space beyond the minimum cell width in non-verbose mode. ### _How was this patch tested?_ - [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible - [x] Add screenshots for manual tests if appropriate - [ ] [Run test](https://kyuubi.apache.org/docs/latest/develop_tools/testing.html#running-tests) locally before make a pull request Closes #2007 from cxzl25/KYUUBI-2006. Closes #2006 68bacef3 [sychen] Add a space beyond the minimum cell width in non-verbose mode Authored-by: sychen Signed-off-by: ulysses-you --- .../main/scala/org/apache/kyuubi/ctl/CommandLineUtils.scala | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kyuubi-ctl/src/main/scala/org/apache/kyuubi/ctl/CommandLineUtils.scala b/kyuubi-ctl/src/main/scala/org/apache/kyuubi/ctl/CommandLineUtils.scala index b8f0aad2d2e..98714f7311c 100644 --- a/kyuubi-ctl/src/main/scala/org/apache/kyuubi/ctl/CommandLineUtils.scala +++ b/kyuubi-ctl/src/main/scala/org/apache/kyuubi/ctl/CommandLineUtils.scala @@ -89,6 +89,9 @@ private[kyuubi] object Tabulator { for (row <- data) { for ((cell, i) <- row.zipWithIndex) { colWidths(i) = math.max(colWidths(i), stringHalfWidth(cell)) + if (!verbose) { + colWidths(i) += 1 + } } }