// Copyright 2025 WIT.COM Inc Licensed GPL 3.0 package forgepb import ( "go.wit.com/log" ) // returns footer func (pb *ForgeConfigs) PrintTable() string { if pb == nil { return "pb was nil" } tablePB := pb.MakeTable() tablePB.PrintTable() return log.Sprintf("forge Configs DefaultTable: %d entries", pb.Len()) } func (pb *ForgeConfigs) MakeTable() *ForgeConfigsTable { t := pb.NewTable("tagList") t.NewUuid() // col := t.AddDirectory() // col.Width = 6 var col *ForgeConfigFunc col = t.AddStringFunc("write", func(c *ForgeConfig) string { if c.Writable { return " r/w" } return "" }) col.Width = 5 col = t.AddStringFunc("private", func(c *ForgeConfig) string { if c.Private { return "true" } return "" }) col.Width = 7 col = t.AddStringFunc("dir", func(c *ForgeConfig) string { if c.Directory { return "true" } return "" }) col.Width = 5 col = t.AddStringFunc("watch", func(c *ForgeConfig) string { if c.Favorite { return "true" } return "" }) col.Width = 5 col = t.AddNamespace() col.Width = -1 return t }