From c6e2af14c0019c43c11e03b9fd79ba4489a38bed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ter=20Szil=C3=A1gyi?= Date: Thu, 25 Jun 2015 12:12:11 +0300 Subject: [PATCH] cmd/geth: limit the maximum chart colums to 6 --- cmd/geth/monitorcmd.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmd/geth/monitorcmd.go b/cmd/geth/monitorcmd.go index b51da91e6..78b67c17c 100644 --- a/cmd/geth/monitorcmd.go +++ b/cmd/geth/monitorcmd.go @@ -85,7 +85,9 @@ func monitor(ctx *cli.Context) { utils.Fatalf("No metrics specified.\n\nAvailable:\n - %s", strings.Join(list, "\n - ")) } sort.Strings(monitored) - + if cols := len(monitored) / ctx.Int(monitorCommandRowsFlag.Name); cols > 6 { + utils.Fatalf("Requested metrics (%d) spans more that 6 columns:\n - %s", len(monitored), strings.Join(monitored, "\n - ")) + } // Create and configure the chart UI defaults if err := termui.Init(); err != nil { utils.Fatalf("Unable to initialize terminal UI: %v", err)