getEnvConfig returns the value of the configuration environment variable <PROGRAM>_<SUFFIX> where <PROGRAM> is the name of the root command in upper case, with all non-ASCII-alphanumeric characters replaced by `_`. If the value is empty or not set, the value of the environment variable COBRA_<SUFFIX
(cmd *Command, suffix string)
| 1012 | // If the value is empty or not set, the value of the environment variable |
| 1013 | // COBRA_<SUFFIX> is returned instead. |
| 1014 | func getEnvConfig(cmd *Command, suffix string) string { |
| 1015 | v := os.Getenv(configEnvVar(cmd.Root().Name(), suffix)) |
| 1016 | if v == "" { |
| 1017 | v = os.Getenv(configEnvVar(configEnvVarGlobalPrefix, suffix)) |
| 1018 | } |
| 1019 | return v |
| 1020 | } |