add 'license show', add printer.NewTableEmpty() along .WithHeaders() (#69)

This commit is contained in:
T. von Dein
2026-07-03 13:52:36 +02:00
parent c197e138ef
commit a07f38e945
5 changed files with 130 additions and 1 deletions

View File

@@ -53,6 +53,24 @@ func NewTable(conf *cfg.Config, columns, rows int) *Table {
return &table
}
func NewTableEmpty(conf *cfg.Config) *Table {
table := Table{Mode: conf.Output, maxwidth: cfg.GetTermWidth()}
table.alignInts = conf.AlignInts
return &table
}
func (table *Table) WithHeaders(headers ...string) *Table {
count := len(headers)
table.Entries = [][]string{}
table.lenHeaders = make([]int, count)
table.Headers = make([]string, count)
table.Addheaders(headers...)
return table
}
func (data *Table) Print() error {
switch data.Mode {
case "markdown", "md":