add snapshot commands

This commit is contained in:
2026-04-22 13:38:02 +02:00
parent a7d979ca38
commit 66221ea219
8 changed files with 298 additions and 10 deletions

View File

@@ -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))
}
}