mirror of
https://github.com/kyverno/kyverno.git
synced 2025-03-10 01:46:55 +00:00
24 lines
644 B
Go
24 lines
644 B
Go
|
package table
|
||
|
|
||
|
import (
|
||
|
"os"
|
||
|
|
||
|
"github.com/kyverno/kyverno/cmd/cli/kubectl-kyverno/utils/color"
|
||
|
"github.com/lensesio/tableprinter"
|
||
|
)
|
||
|
|
||
|
func NewTablePrinter() *tableprinter.Printer {
|
||
|
printer := tableprinter.New(os.Stdout)
|
||
|
printer.BorderTop, printer.BorderBottom, printer.BorderLeft, printer.BorderRight = true, true, true, true
|
||
|
printer.CenterSeparator = "│"
|
||
|
printer.ColumnSeparator = "│"
|
||
|
printer.RowSeparator = "─"
|
||
|
printer.RowCharLimit = 300
|
||
|
printer.HeaderBgColor = color.HeaderBgColor
|
||
|
printer.HeaderFgColor = color.HeaderFgColor
|
||
|
printer.RowLengthTitle = func(rowsLength int) bool {
|
||
|
return rowsLength > 10
|
||
|
}
|
||
|
return printer
|
||
|
}
|