mirror of
https://codeberg.org/scip/esctl.git
synced 2026-08-24 12:44:18 +02:00
add 'license show', add printer.NewTableEmpty() along .WithHeaders() (#69)
This commit is contained in:
@@ -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":
|
||||
|
||||
Reference in New Issue
Block a user