diff options
| author | Jeff Carr <[email protected]> | 2025-10-16 15:17:51 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-10-16 15:17:51 -0500 |
| commit | f315f5b6423e5c9d7e788e8eeb7ea33771530bf1 (patch) | |
| tree | 442b202baa294a6e7cf13b93dc24a22ad38d92ee | |
| parent | 045697fb6a7f4f11d22219983d56aba850d8f8fe (diff) | |
try to sort by time. didn't work
| -rw-r--r-- | tablePB.go | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -13,6 +13,11 @@ import ( ) func PrintTable(pb *guipb.Table) { + PrintTableLimit(pb, -1) +} + +// limits the number of out lines +func PrintTableLimit(pb *guipb.Table, limit int) { // fmt.Info("print PB here") if pb.Grid == nil { @@ -42,6 +47,7 @@ func PrintTable(pb *guipb.Table) { header, _ := StandardTableRow(sizes, args) fmt.Println(header) + var counter int // now print the table rows for i := range len(pb.AnyCols[0].Vals) { var cells []string @@ -57,6 +63,13 @@ func PrintTable(pb *guipb.Table) { line += "FMT: " + fmtline } fmt.Println(line) + if limit < 0 { + continue + } + counter += 1 + if counter > limit { + break + } } } |
