1
0
Fork 0

Added tests to the main package and completely reworked the code around that

This commit is contained in:
Julien Dessaux 2020-02-24 23:05:45 +01:00
parent 2661ce9a2b
commit cadb15f7af
17 changed files with 285 additions and 239 deletions

21
zabbix/flags.go Normal file
View file

@ -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
}