Add db option

This commit is contained in:
Elara 2023-12-03 19:40:12 -08:00
parent 976c6c130c
commit c18e4b1ed1

View File

@ -37,6 +37,7 @@ func openDB(path string) (*sql.DB, error) {
func main() { func main() {
configPath := pflag.StringP("config", "c", "./lemmy-reply-bot.toml", "Path to the config file") 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") dryRun := pflag.BoolP("dry-run", "D", false, "Don't actually send comments, just check for matches")
pflag.Parse() pflag.Parse()
@ -49,7 +50,7 @@ func main() {
log.Fatal("Error loading config file").Err(err).Send() log.Fatal("Error loading config file").Err(err).Send()
} }
db, err := openDB("replied.db") db, err := openDB(*dbPath)
if err != nil { if err != nil {
log.Fatal("Error opening reply database").Err(err).Send() log.Fatal("Error opening reply database").Err(err).Send()
} }