From cadb15f7afb5e7c88667eb4006209efca17744af Mon Sep 17 00:00:00 2001 From: Julien Dessaux Date: Mon, 24 Feb 2020 23:05:45 +0100 Subject: Added tests to the main package and completely reworked the code around that --- zabbix/flags.go | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 zabbix/flags.go (limited to 'zabbix/flags.go') diff --git a/zabbix/flags.go b/zabbix/flags.go new file mode 100644 index 0000000..3e95321 --- /dev/null +++ b/zabbix/flags.go @@ -0,0 +1,21 @@ +package zabbix + +import ( + "flag" +) + +var ( + stateFileName string + workDir string +) + +func processFlags() (err error) { + flag.StringVar(&stateFileName, "f", "", "Force the state file to use, defaults to "+bareosStateFile+" if it exists else "+baculaStateFile+".") + flag.StringVar(&workDir, "w", "", "Force the work directory to use, defaults to "+bareosWorkDir+" if it exists else "+baculaWorkDir+".") + flag.Parse() + err = checkWorkDir() + if err == nil { + err = checkStateFile() + } + return +} -- cgit v1.2.3