diff options
| author | Jeff Carr <[email protected]> | 2025-10-16 15:18:04 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-10-16 15:18:04 -0500 |
| commit | 9a0089928e713a35b4a5c0ab46b86fd1a2e498da (patch) | |
| tree | d8d91e8d9797f3222bcfd8d244c137e34eaadbd5 /tableStats.go | |
| parent | 43599276915dbcef6f941aa31cfea9cc2c2512aa (diff) | |
try to sort by time. didn't work
Diffstat (limited to 'tableStats.go')
| -rw-r--r-- | tableStats.go | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/tableStats.go b/tableStats.go index ba45e31..0a278e0 100644 --- a/tableStats.go +++ b/tableStats.go @@ -3,15 +3,24 @@ package gitpb import ( - "go.wit.com/log" "go.wit.com/lib/cobol" + "go.wit.com/log" ) func (pb *Stats) PrintTable() string { t := pb.MakeTable("missing repos table") + // limit the number of lines t.PrintTable() - return log.Sprintf("pb.StatsTB: total=(%d)", pb.Len()) + return log.Sprintf("pb.StatsTB: top 16 refs total=(%d)", pb.Len()) +} + +func (pb *Stats) PrintTableLimit(limit int) string { + t := pb.MakeTable("missing repos table") + + // limit the number of lines + t.PrintTableLimit(limit) + return log.Sprintf("pb.StatsTB: top %d refs total=(%d)", limit, pb.Len()) } func (pb *Stats) MakeTable(name string) *StatsTable { @@ -23,6 +32,10 @@ func (pb *Stats) MakeTable(name string) *StatsTable { col = t.AddPatchId() col.Width = 10 + col = t.AddHash() + col.Width = 10 + col.Header.Name = "Git Hash" + col = t.AddStringFunc("something", func(r *Stat) string { return "notsure" }) |
