|
|
|
|
@ -110,7 +110,7 @@ func init() {
|
|
|
|
|
rootCmd.PersistentFlags().StringVarP(&data, "data", "d", "", "data directory")
|
|
|
|
|
rootCmd.PersistentFlags().StringVarP(&driver, "driver", "", "", "database driver")
|
|
|
|
|
rootCmd.PersistentFlags().StringVarP(&dsn, "dsn", "", "", "database source name(aka. DSN)")
|
|
|
|
|
rootCmd.PersistentFlags().BoolVarP(&public, "public", "", true, "")
|
|
|
|
|
rootCmd.PersistentFlags().BoolVarP(&public, "public", "", false, "")
|
|
|
|
|
|
|
|
|
|
err := viper.BindPFlag("mode", rootCmd.PersistentFlags().Lookup("mode"))
|
|
|
|
|
if err != nil {
|
|
|
|
|
@ -145,7 +145,7 @@ func init() {
|
|
|
|
|
viper.SetDefault("driver", "sqlite")
|
|
|
|
|
viper.SetDefault("addr", "")
|
|
|
|
|
viper.SetDefault("port", 8081)
|
|
|
|
|
viper.SetDefault("public", true)
|
|
|
|
|
viper.SetDefault("public", false)
|
|
|
|
|
viper.SetEnvPrefix("memos")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -166,9 +166,10 @@ dsn: %s
|
|
|
|
|
addr: %s
|
|
|
|
|
port: %d
|
|
|
|
|
mode: %s
|
|
|
|
|
public: %t
|
|
|
|
|
driver: %s
|
|
|
|
|
---
|
|
|
|
|
`, instanceProfile.Version, instanceProfile.Data, instanceProfile.DSN, instanceProfile.Addr, instanceProfile.Port, instanceProfile.Mode, instanceProfile.Driver)
|
|
|
|
|
`, instanceProfile.Version, instanceProfile.Data, instanceProfile.DSN, instanceProfile.Addr, instanceProfile.Port, instanceProfile.Mode, instanceProfile.Public, instanceProfile.Driver)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func printGreetings() {
|
|
|
|
|
|