fix: update default flag values

This commit is contained in:
Derrick Hammer 2023-04-30 02:14:14 -04:00
parent 58165e01af
commit 241db4deb6
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 4 additions and 2 deletions

View File

@ -1,6 +1,7 @@
package config package config
import ( import (
"errors"
"fmt" "fmt"
"github.com/spf13/pflag" "github.com/spf13/pflag"
"github.com/spf13/viper" "github.com/spf13/viper"
@ -15,12 +16,13 @@ func Init() {
viper.AddConfigPath(".") viper.AddConfigPath(".")
viper.SetEnvPrefix("LUME_WEB_PORTAL") viper.SetEnvPrefix("LUME_WEB_PORTAL")
pflag.String("database.type", "mysql", "Database type") pflag.String("database.type", "sqlite", "Database type")
pflag.String("database.host", "localhost", "Database host") pflag.String("database.host", "localhost", "Database host")
pflag.Int("database.port", 3306, "Database port") pflag.Int("database.port", 3306, "Database port")
pflag.String("database.user", "root", "Database user") pflag.String("database.user", "root", "Database user")
pflag.String("database.password", "", "Database password") pflag.String("database.password", "", "Database password")
pflag.String("database.name", "mydb", "Database name") pflag.String("database.name", "lumeweb_portal", "Database name")
pflag.String("database.path", "./db.sqlite", "Database path for SQLite")
pflag.Parse() pflag.Parse()
err := viper.BindPFlags(pflag.CommandLine) err := viper.BindPFlags(pflag.CommandLine)