summaryrefslogtreecommitdiff
path: root/tableDefault.go
blob: 33abe2652486b3bdc9c20a0c8fac1d3b0328f484 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// Copyright 2025 WIT.COM Inc Licensed GPL 3.0

package zoopb

// this is the default table layout for repos in forge

func (pb *Packages) PrintTable() {
	tablePB := pb.makeDefaultTable()
	tablePB.PrintTable()
}

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.AddName()
	col.Width = 30

	col = t.AddVersion()
	col.Width = 20

	col = t.AddPkgName()
	col.Width = -1
	col.Header.Name = "apt package path"

	return t
}