Render all tables the same way
This commit is contained in:
parent
8b7269ae09
commit
087e096e60
11 changed files with 16 additions and 9 deletions
|
@ -68,7 +68,7 @@ var (
|
|||
if common.OutputFormat == common.OutputFormatCSV {
|
||||
t.RenderCSV()
|
||||
} else {
|
||||
t.SetStyle(table.StyleLight)
|
||||
common.StylizeTable(t)
|
||||
t.Render()
|
||||
}
|
||||
case common.OutputFormatQR, common.OutputFormatDefault:
|
||||
|
|
|
@ -78,7 +78,7 @@ var (
|
|||
if common.OutputFormat == common.OutputFormatCSV {
|
||||
t.RenderCSV()
|
||||
} else {
|
||||
t.SetStyle(table.StyleLight)
|
||||
common.StylizeTable(t)
|
||||
t.Render()
|
||||
}
|
||||
default:
|
||||
|
|
|
@ -60,7 +60,7 @@ var (
|
|||
if common.OutputFormat == common.OutputFormatCSV {
|
||||
t.RenderCSV()
|
||||
} else {
|
||||
t.SetStyle(table.StyleLight)
|
||||
common.StylizeTable(t)
|
||||
t.Render()
|
||||
}
|
||||
default:
|
||||
|
|
|
@ -73,7 +73,7 @@ var (
|
|||
if common.OutputFormat == common.OutputFormatCSV {
|
||||
t.RenderCSV()
|
||||
} else {
|
||||
t.SetStyle(table.StyleLight)
|
||||
common.StylizeTable(t)
|
||||
t.Render()
|
||||
}
|
||||
default:
|
||||
|
|
|
@ -81,7 +81,7 @@ var (
|
|||
if common.OutputFormat == common.OutputFormatCSV {
|
||||
t.RenderCSV()
|
||||
} else {
|
||||
t.SetStyle(table.StyleLight)
|
||||
common.StylizeTable(t)
|
||||
t.Render()
|
||||
}
|
||||
default:
|
||||
|
|
|
@ -77,7 +77,7 @@ var (
|
|||
if common.OutputFormat == common.OutputFormatCSV {
|
||||
t.RenderCSV()
|
||||
} else {
|
||||
t.SetStyle(table.StyleLight)
|
||||
common.StylizeTable(t)
|
||||
t.Render()
|
||||
}
|
||||
default:
|
||||
|
|
|
@ -112,7 +112,7 @@ var (
|
|||
if common.OutputFormat == common.OutputFormatCSV {
|
||||
t.RenderCSV()
|
||||
} else {
|
||||
t.SetStyle(table.StyleLight)
|
||||
common.StylizeTable(t)
|
||||
t.Render()
|
||||
}
|
||||
}
|
||||
|
|
|
@ -117,7 +117,7 @@ var (
|
|||
if common.OutputFormat == common.OutputFormatCSV {
|
||||
t.RenderCSV()
|
||||
} else {
|
||||
t.SetStyle(table.StyleLight)
|
||||
common.StylizeTable(t)
|
||||
t.Render()
|
||||
}
|
||||
default:
|
||||
|
|
|
@ -108,7 +108,7 @@ var (
|
|||
if common.OutputFormat == common.OutputFormatCSV {
|
||||
t.RenderCSV()
|
||||
} else {
|
||||
t.SetStyle(table.StyleLight)
|
||||
common.StylizeTable(t)
|
||||
t.Render()
|
||||
}
|
||||
default:
|
||||
|
|
|
@ -67,6 +67,7 @@ var versionCmd = &cobra.Command{
|
|||
if common.OutputFormat == common.OutputFormatCSV {
|
||||
t.RenderCSV()
|
||||
} else {
|
||||
common.StylizeTable(t)
|
||||
t.Render()
|
||||
}
|
||||
default:
|
||||
|
|
|
@ -3,6 +3,8 @@ package common
|
|||
import (
|
||||
"log"
|
||||
|
||||
"github.com/jedib0t/go-pretty/v6/table"
|
||||
|
||||
"gitlab.com/signald/signald-go/signald"
|
||||
)
|
||||
|
||||
|
@ -30,3 +32,7 @@ func Must(err error) {
|
|||
log.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
func StylizeTable(t table.Writer) {
|
||||
t.SetStyle(table.StyleLight)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue