summaryrefslogtreecommitdiff
path: root/table.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-10-24 00:57:44 -0500
committerJeff Carr <[email protected]>2025-10-24 00:57:44 -0500
commit1b34a295788425c01b25a6ce786081ceb334b908 (patch)
tree0713202236fa7a89e02f11752d8ead90a512181b /table.go
parent8ae45ad4992a156dc5631a937aab4ee56a8e638c (diff)
remove gui from .proto until /gui package is redone
Diffstat (limited to 'table.go')
-rw-r--r--table.go49
1 files changed, 11 insertions, 38 deletions
diff --git a/table.go b/table.go
index d6bcb04..427dfff 100644
--- a/table.go
+++ b/table.go
@@ -2,45 +2,18 @@
package ENV
-import "fmt"
+import (
+ "fmt"
-func PrintTable() string {
- t := envPB.MakeTable("ENV table")
+ "go.wit.com/lib/cobol"
+)
- // limit the number of lines
- t.PrintTable()
+func PrintTable() string {
+ var data [][]string
+ data = append(data, []string{"New Source", "ENV[name]", "Value"})
+ for k := range envPB.IterAll() {
+ data = append(data, []string{k.Global, k.Var, k.Value})
+ }
+ cobol.SimpleTableSizes(data, []int{20, 20, -1})
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
-}