You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
then I would expect that a call to envconfig.Usage("CMD", &cfg) should print it as LOG_LEVEL ..., instead of that I get CMD_LOG_LEVEL.
Same thing seems to be happening with the error from envconfig.Process("CMD", &cfg). When missing a required variable with an override I get required key CMD_LOG_LEVEL missing value as a message.
Thanks,
Chris
The text was updated successfully, but these errors were encountered:
You're totally right here. I believe the code would accept either <prefix>_<name> or just <name> (when tagged with "envconfig"), but the non-prefixed version should definitely be favored. I'd happily merge a PR that fixed this :)
@TonyPythoneer I also need to have the Usage() print the alternate names instead of the key.
I looked at the README.md and did not find the info on how to do it.
Can you point me in the right direction?
Let's say I define a bunch of variables but one of them has an override e.g.
LogLevel string desc:"Log level override" envconfig:"LOG_LEVEL"
then I would expect that a call to
envconfig.Usage("CMD", &cfg)
should print it asLOG_LEVEL ...
, instead of that I getCMD_LOG_LEVEL
.Same thing seems to be happening with the error from
envconfig.Process("CMD", &cfg)
. When missing a required variable with an override I getrequired key CMD_LOG_LEVEL missing value
as a message.Thanks,
Chris
The text was updated successfully, but these errors were encountered: