diff options
Diffstat (limited to 'tablePackages.go')
| -rw-r--r-- | tablePackages.go | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/tablePackages.go b/tablePackages.go new file mode 100644 index 0000000..0a95ef6 --- /dev/null +++ b/tablePackages.go @@ -0,0 +1,48 @@ +// Copyright 2025 WIT.COM Inc Licensed GPL 3.0 + +package zoopb + +import ( + "go.wit.com/log" +) + +// this is the default table layout for repos in forge + +func (pb *Packages) PrintTable() string { + tablePB := pb.MakeDefaultTable() + tablePB.PrintTable() + return log.Sprintf("pb.DefaultTable: %d packages", pb.Len()) +} + +func (pb *Packages) MakeDefaultTable() *PackagesTable { + t := pb.NewTable("apt packages") + t.NewUuid() + + var col *PackageFunc + + col = t.AddStringFunc(" I", func(p *Package) string { + if p.Installed { + return " X" + } + return "" + }) + col.Width = 3 + + col = t.AddMD5SUM() + col.Width = 6 + + col = t.AddSHA256() + col.Width = 6 + + col = t.AddPackage() + col.Width = 30 + + col = t.AddVersion() + col.Width = 20 + + col = t.AddFilename() + col.Width = -1 + col.Header.Name = "apt package path" + + return t +} |
