streamline table api (#101)

This commit is contained in:
T. von Dein
2026-08-09 21:53:47 +02:00
parent 59331fc721
commit 325433ed81
30 changed files with 349 additions and 316 deletions

View File

@@ -84,8 +84,8 @@ func SnapshotList(conf *cfg.Config) error {
}
}
table := printer.NewTable(conf, 5, len(snapshots))
table.Addheaders("name", "index", "start", "orphaned", "status")
table := printer.NewTable(conf).WithSize(5, len(snapshots)).
WithHeaders("name", "index", "start", "orphaned", "status")
for idx, snap := range snapshots {
table.Entries[idx] = []any{
@@ -118,8 +118,8 @@ func SnapshotShow(conf *cfg.Config, snapshot string) error {
return errors.New("no snapshot retrieved")
}
table := printer.NewTable(conf, 2, 17)
table.Addheaders("snapshot property", "value")
table := printer.NewTable(conf).WithSize(2, 17).
WithHeaders("snapshot property", "value")
snap := res.Snapshots[0]