Move flag handling into cmd/

This commit is contained in:
Daan Sprenkels
2019-11-08 22:17:05 +01:00
parent 853945a138
commit ab0cf15c7b
2 changed files with 8 additions and 15 deletions

View File

@@ -10,9 +10,12 @@ import (
)
func main() {
var databasePath, fileStorePath string
flag.StringVar(&databasePath, "database", "", "Location of the database file")
flag.Parse()
if err := db.Open(); err != nil {
if err := db.Open(databasePath); err != nil {
log.Fatalln(err)
}
defer db.Close()