refactor: rename config file cli parameter for consistency

- rename configfile parameter to parameter_configfile
- update references to the configfile parameter

🤖
This commit is contained in:
Sebastian Mark 2024-11-05 23:27:28 +01:00
parent f7c099876b
commit 1dd42d3c14

View file

@ -63,16 +63,16 @@ func Start() {
parameter_url = flag.String("url", "", "GoTomato Server URL (eg ws://localhost:8080/ws)") parameter_url = flag.String("url", "", "GoTomato Server URL (eg ws://localhost:8080/ws)")
parameter_password = flag.String("password", "", "Control password for pomodoro session") parameter_password = flag.String("password", "", "Control password for pomodoro session")
configfile = flag.String("config", defaultConfigFile, "Path to config file") parameter_configfile = flag.String("config", defaultConfigFile, "Path to config file")
) )
flag.Parse() flag.Parse()
// read passed config file or try to use default config // read passed config file or try to use default config
if *configfile != defaultConfigFile { if *parameter_configfile != defaultConfigFile {
config = helper.ParseConfig(*configfile) config = helper.ParseConfig(*parameter_configfile)
} else { } else {
if helper.FileExists(*configfile) { if helper.FileExists(defaultConfigFile) {
config = helper.ParseConfig(*configfile) config = helper.ParseConfig(defaultConfigFile)
} }
} }