${LOG_LEVEL:-info}
would be even more shellish, or?
> Am 22.04.2020 um 11:38 schrieb Yann Ylavic <[email protected]>:
>
> I would like to be able to specify a default/fallback value for when
> an environment variable is not defined while loading the
> configuration, like the ${SOME_VAR-default} form in bash/shells.
>
> In docker (mainly docker-compose) where quite some settings are passed
> to the container through env vars, this would be really useful for an
> httpd.conf "template" with default values for undefined vars.
>
> I first thought of "<IfEnv [!]blah>" or alike, but it quickly becomes
> hard to read/follow, while e.g:
> LogLevel "${LOG_LEVEL-info}"
> would be lovely :)
>
> So would a patch like the attached be acceptable?
> It uses '-' as separator but any other char would do (if the minus
> sign is likely to break configuration where it shouldn't be
> interpreted), though that would look less like a shell expansion..
>
> Regards,
> Yann.
> <ap_resolve_env.diff>