confuse icon indicating copy to clipboard operation
confuse copied to clipboard

Feature Request: Switch to using sayanarijit/expandvars for as_str_expanded()

Open ravensorb opened this issue 2 years ago • 1 comments

Was curious if there was any interest in switching over to using https://github.com/sayanarijit/expandvars as it provides support for standard unix/go env variable expansion (can be helpful in setting default values).

Example of a config file with this syntax:

database:
   server: ${DATABASE_SERVER:-localhost}
   port: ${DATABASE_PORT:-5432}
   user: ${DATABASE_USERNAME:-app}
   passsword: ${DATABASE_PASSWORD}

ravensorb avatar Apr 04 '23 14:04 ravensorb

Hi there! Confuse already has a mechanism for incorporating environment variables as default values (via a naming convention based on the structure of the config document). It's not entirely clear to me what this would add beyond that, and it would add some important complexity: it's an extra "programming language" beyond YAML that users need to understand.

If you're interested in this, could you elaborate on what's currently missing with our env-var system?

sampsyo avatar Apr 06 '23 21:04 sampsyo