From c18e4b1ed141d52aed82692c3b50603631a0648a Mon Sep 17 00:00:00 2001 From: Elara Musayelyan Date: Sun, 3 Dec 2023 19:40:12 -0800 Subject: [PATCH] Add db option --- main.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index 3ef8488..d1627df 100644 --- a/main.go +++ b/main.go @@ -37,6 +37,7 @@ func openDB(path string) (*sql.DB, error) { func main() { configPath := pflag.StringP("config", "c", "./lemmy-reply-bot.toml", "Path to the config file") + dbPath := pflag.StringP("db-path", "d", "./replied.db", "Path to the database") dryRun := pflag.BoolP("dry-run", "D", false, "Don't actually send comments, just check for matches") pflag.Parse() @@ -49,7 +50,7 @@ func main() { log.Fatal("Error loading config file").Err(err).Send() } - db, err := openDB("replied.db") + db, err := openDB(*dbPath) if err != nil { log.Fatal("Error opening reply database").Err(err).Send() }