Handle --two-words as TMTWO_WORDS env var

This commit is contained in:
Ethan Frey
2017-06-15 20:16:22 +02:00
parent 59a77e7bef
commit 3400cee845
2 changed files with 22 additions and 15 deletions

View File

@ -58,7 +58,7 @@ func initEnv(prefix string) {
// env variables with TM prefix (eg. TM_ROOT)
viper.SetEnvPrefix(prefix)
viper.SetEnvKeyReplacer(strings.NewReplacer(".", "_"))
viper.SetEnvKeyReplacer(strings.NewReplacer(".", "_", "-", "_"))
viper.AutomaticEnv()
}