Provide a test mode to check plugins easily

This commit is contained in:
Evan Phoenix
2015-04-06 17:24:24 -07:00
parent 7b0c09d5e9
commit 609cba2cd5
3 changed files with 62 additions and 5 deletions

View File

@@ -12,7 +12,7 @@ import (
)
var fDebug = flag.Bool("debug", false, "show metrics as they're generated to stdout")
var fTest = flag.Bool("test", false, "gather metrics, print them out, and exit")
var fConfig = flag.String("config", "", "configuration file to load")
func main() {
@@ -46,6 +46,20 @@ func main() {
log.Fatal(err)
}
if *fTest {
err = ag.Test()
if err != nil {
log.Fatal(err)
}
return
}
err = ag.Connect()
if err != nil {
log.Fatal(err)
}
shutdown := make(chan struct{})
signals := make(chan os.Signal)