fix: update default flag values
This commit is contained in:
parent
58165e01af
commit
241db4deb6
|
@ -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)
|
||||||
|
|
Loading…
Reference in New Issue