Skip to content

Commit c6e2af1

Browse files
committed
cmd/geth: limit the maximum chart colums to 6
1 parent 3ea6b5a commit c6e2af1

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

cmd/geth/monitorcmd.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,9 @@ func monitor(ctx *cli.Context) {
8585
utils.Fatalf("No metrics specified.\n\nAvailable:\n - %s", strings.Join(list, "\n - "))
8686
}
8787
sort.Strings(monitored)
88-
88+
if cols := len(monitored) / ctx.Int(monitorCommandRowsFlag.Name); cols > 6 {
89+
utils.Fatalf("Requested metrics (%d) spans more that 6 columns:\n - %s", len(monitored), strings.Join(monitored, "\n - "))
90+
}
8991
// Create and configure the chart UI defaults
9092
if err := termui.Init(); err != nil {
9193
utils.Fatalf("Unable to initialize terminal UI: %v", err)

0 commit comments

Comments
 (0)