From e01db2c144b3609fdf0f03c5d9a1715f0ad1e961 Mon Sep 17 00:00:00 2001 From: "Sean E. Russell" Date: Tue, 8 Feb 2022 11:50:52 -0600 Subject: [PATCH] Fixes #200, colorscheme in config file causes error. --- cmd/gotop/main.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/cmd/gotop/main.go b/cmd/gotop/main.go index 1e979c52..da0208ee 100644 --- a/cmd/gotop/main.go +++ b/cmd/gotop/main.go @@ -101,11 +101,13 @@ func parseArgs() error { opflag.Usage() os.Exit(0) } - cs, err := colorschemes.FromName(conf.ConfigDir, *color) - if err != nil { - return err + if *color != "" { + cs, err := colorschemes.FromName(conf.ConfigDir, *color) + if err != nil { + return err + } + conf.Colorscheme = cs } - conf.Colorscheme = cs if *fahrenheit { conf.TempScale = 'F' } else {