summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-10-16 15:17:51 -0500
committerJeff Carr <[email protected]>2025-10-16 15:17:51 -0500
commitf315f5b6423e5c9d7e788e8eeb7ea33771530bf1 (patch)
tree442b202baa294a6e7cf13b93dc24a22ad38d92ee
parent045697fb6a7f4f11d22219983d56aba850d8f8fe (diff)
try to sort by time. didn't work
-rw-r--r--tablePB.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/tablePB.go b/tablePB.go
index 2cf42b0..cb06bfb 100644
--- a/tablePB.go
+++ b/tablePB.go
@@ -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
+ }
}
}