// Copyright 2025 WIT.COM Inc Licensed GPL 3.0 package forgepb import ( "time" "go.wit.com/log" ) func (pset *Set) PrintTable() { if pset == nil || pset.Patches == nil { return } log.DaemonMode(true) // don't timestamp lines tablePB := pset.Patches.MakeTable() tablePB.PrintTable() log.Printf("pset.DefaultTable: %d patches\n", pset.Patches.Len()) } func (pb *Sets) PrintTable() { for pset := range pb.IterAll() { if pset.Patches == nil { continue } tablePB := pset.Patches.MakeTable() tablePB.PrintTable() log.Printf("psets.DefaultTable loop: %d patches\n", pset.Patches.Len()) } } func (pb *Patches) PrintTable() { log.DaemonMode(true) // don't timestamp lines tablePB := pb.MakeTable() tablePB.PrintTable() log.Printf("pb.DefaultTable: %d patches\n", pb.Len()) } func (pb *Patches) MakeTable() *PatchesTable { t := pb.NewTable("tagList") t.NewUuid() col := t.AddNamespace() col.Width = 28 col = t.AddCommitHash() col.Width = 8 col = t.AddPatchId() col.Width = 8 col = t.AddNewHash() col.Width = 8 col = t.AddTimeFunc("ctime", func(p *Patch) time.Time { // todo return p.Ctime.AsTime() }) col.Width = 4 col = t.AddComment() col.Width = 80 return t }