From d4d14aa94a645d8ea70b5659444fba8eec677aea Mon Sep 17 00:00:00 2001 From: Sebastian Mark Date: Sat, 2 Nov 2024 10:56:53 +0100 Subject: [PATCH] fix: update config file handling - show default config in help - only use default config if exists, otherwise use passed file --- cmd/client/app.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cmd/client/app.go b/cmd/client/app.go index f4652ab..bb5e280 100644 --- a/cmd/client/app.go +++ b/cmd/client/app.go @@ -64,16 +64,16 @@ func Start() { parameter_url = flag.String("url", "", "GoTomato Server URL (eg ws://localhost:8080/ws)") parameter_password = flag.String("password", "", "Control password for pomodoro session") - configfile = flag.String("config", "", "Path to config file") + configfile = flag.String("config", defaultConfigFile, "Path to config file") ) flag.Parse() // read passed config file or try to use default config - if *configfile != "" { + if *configfile != defaultConfigFile { config = helper.ParseConfig(*configfile) } else { - if helper.FileExists(defaultConfigFile) { - config = helper.ParseConfig(defaultConfigFile) + if helper.FileExists(*configfile) { + config = helper.ParseConfig(*configfile) } }