Show helper text for empty tables

This commit is contained in:
Christian Muehlhaeuser 2020-08-23 12:10:03 +02:00
parent b43f0d52a9
commit 3f563e17e6
No known key found for this signature in database
GPG Key ID: 3CF9FA45CA1EBB7E
1 changed files with 4 additions and 0 deletions

View File

@ -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()
}