aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSmsS4 <36403983+SmsS4@users.noreply.github.com>2023-04-20 20:03:27 +0330
committerGitHub <noreply@github.com>2023-04-20 09:33:27 -0700
commit4131874fa8844d1ed6d71ae1cc839f2fc71a81d2 (patch)
treeda5b908354fadc69faadc5773b3e73009e61f9b4
parent9f55c7c90e51621f2bc298be159b3fcc12aaddbc (diff)
downloadseaweedfs-4131874fa8844d1ed6d71ae1cc839f2fc71a81d2.tar.xz
seaweedfs-4131874fa8844d1ed6d71ae1cc839f2fc71a81d2.zip
use env for flags wtih dot in name (#4415)
-rw-r--r--weed/util/fla9/fla9.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/weed/util/fla9/fla9.go b/weed/util/fla9/fla9.go
index 8cea07311..3770408d2 100644
--- a/weed/util/fla9/fla9.go
+++ b/weed/util/fla9/fla9.go
@@ -1059,11 +1059,13 @@ func (f *FlagSet) ParseEnv(environ []string) error {
}
envKey := strings.ToUpper(flag.Name)
+
if f.envPrefix != "" {
envKey = f.envPrefix + "_" + envKey
}
envKey = strings.Replace(envKey, "-", "_", -1)
-
+ envKey = strings.Replace(envKey, ".", "_", -1)
+
value, isSet := env[envKey]
if !isSet {
continue