Allow specifying data source via environment variable
This commit is contained in:
parent
b4bbf10287
commit
8cba945823
1 changed files with 5 additions and 0 deletions
|
@ -6,6 +6,7 @@ import (
|
|||
"log"
|
||||
"net/http"
|
||||
_ "net/http/pprof"
|
||||
"os"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
@ -25,6 +26,10 @@ func main() {
|
|||
flag.BoolVar(&rollStatistics, "statistics", false, "print dice roll statistics and exit")
|
||||
flag.Parse()
|
||||
|
||||
if dataSource == "" {
|
||||
dataSource = os.Getenv("BGAMMON_DB")
|
||||
}
|
||||
|
||||
if rollStatistics {
|
||||
printRollStatistics()
|
||||
return
|
||||
|
|
Loading…
Reference in a new issue