fix: Match kubectl table style for simpler scripting (#1363)

Fixes #1322.
This commit is contained in:
Kyle Carberry
2022-05-10 15:57:07 -05:00
committed by GitHub
parent 2df92e6fd3
commit e0a7aec228
6 changed files with 164 additions and 33 deletions
+3 -6
View File
@@ -34,10 +34,8 @@ func templateList() *cobra.Command {
return nil
}
tableWriter := table.NewWriter()
tableWriter.SetStyle(table.StyleLight)
tableWriter.Style().Options.SeparateColumns = false
tableWriter.AppendHeader(table.Row{"Name", "Source", "Last Updated", "Used By"})
tableWriter := cliui.Table()
tableWriter.AppendHeader(table.Row{"Name", "Last Updated", "Used By"})
for _, template := range templates {
suffix := ""
@@ -45,8 +43,7 @@ func templateList() *cobra.Command {
suffix = "s"
}
tableWriter.AppendRow(table.Row{
cliui.Styles.Bold.Render(template.Name),
"Archive",
template.Name,
template.UpdatedAt.Format("January 2, 2006"),
cliui.Styles.Fuschia.Render(fmt.Sprintf("%d developer%s", template.WorkspaceOwnerCount, suffix)),
})