Added tests to the main package and completely reworked the code around that
This commit is contained in:
parent
2661ce9a2b
commit
cadb15f7af
17 changed files with 285 additions and 239 deletions
21
zabbix/flags.go
Normal file
21
zabbix/flags.go
Normal 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
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue