resolveEnvDefault

private fnResolvedDefault resolveEnvDefault(string spec) @safe

Resolves a default value specification possibly referencing an environment variable.

The specification is treated as an environment reference only when it starts with a well-formed $NAME:

  • $VAR → value of environment variable VAR when set and non-empty; otherwise no default.
  • $VAR or fallback → env value when set; otherwise the literal fallback (the or splitter is honored only in this form).
  • $VAR/suffix → env value with the suffix appended when set; otherwise the whole specification kept verbatim as a literal default.
  • anything else → the literal as-is (no or splitting, so [default: black or white] keeps the full text).

Quotes around parts are stripped when present (e.g., "$HOME/file").

Parameters

specThe contents captured from [default: ...] (without brackets).

Returns

A ResolvedDefault indicating whether a default is present and its value.