mirror of
https://codeberg.org/scip/esctl.git
synced 2026-08-24 04:54:18 +02:00
add snapshot commands
This commit is contained in:
@@ -31,11 +31,11 @@ type Table struct {
|
||||
entries [][]string
|
||||
}
|
||||
|
||||
func NewTable(size int) *Table {
|
||||
func NewTable(columns, rows int) *Table {
|
||||
table := Table{}
|
||||
|
||||
table.headers = make([]string, size)
|
||||
table.entries = make([][]string, size)
|
||||
table.headers = make([]string, columns)
|
||||
table.entries = make([][]string, rows)
|
||||
|
||||
return &table
|
||||
}
|
||||
@@ -106,3 +106,9 @@ func (data *Table) Sort() {
|
||||
return data.entries[i][0] < data.entries[j][0]
|
||||
})
|
||||
}
|
||||
|
||||
func (data *Table) Addheaders(headers ...string) {
|
||||
for idx, header := range headers {
|
||||
data.headers[idx] = bold(strings.ToUpper(header))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user