summaryrefslogtreecommitdiff
path: root/table.go
blob: d6bcb04b3ecb1ae9a4906eb818698145b1448d22 (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
38
39
40
41
42
43
44
45
46
// Copyright 2025 WIT.COM Inc Licensed GPL 3.0

package ENV

import "fmt"

func PrintTable() string {
	t := envPB.MakeTable("ENV table")

	// limit the number of lines
	t.PrintTable()
	return fmt.Sprintf("ENV: total=(%d)", envPB.Len())
}

func (pb *Keys) MakeTable(name string) *KeysTable {
	t := pb.NewTable(name)
	t.NewUuid()

	var col *KeyFunc

	col = t.AddStringFunc("Source", func(k *Key) string {
		return k.Global
	})
	col.Width = 20

	col = t.AddVar()
	col.Width = 20
	col.Header.Name = "ENV[name] ="

	col = t.AddValue()
	col.Width = -1
	col.Header.Name = "Value"
	// col.Header.Name = "Git Hash"

	/*
		col = t.AddStringFunc("age", func(r *Key) string {
			return cobol.Time(r.Ctime)
		})
		col.Width = 28

		col = t.AddSubject()
		col.Width = -1
	*/

	return t
}