From 3f563e17e6f8f14630823093dd97226a2b1566e1 Mon Sep 17 00:00:00 2001 From: Christian Muehlhaeuser Date: Sun, 23 Aug 2020 12:10:03 +0200 Subject: [PATCH] Show helper text for empty tables --- stats.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/stats.go b/stats.go index d883795..fecca9c 100644 --- a/stats.go +++ b/stats.go @@ -273,6 +273,10 @@ func printTable(cols []string, emptyText string, data []kv) { tab.AppendRow([]interface{}{kv.Key, kv.Value}) tab.AppendSeparator() } + if len(data) == 0 { + tab.AppendRow(table.Row{emptyText}) + } + tab.Render() fmt.Println() }