ResolvedDefault indicating whether a default is present and its value.resolveEnvDefault
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 variableVARwhen set and non-empty; otherwise no default.$VAR or fallback→ env value when set; otherwise the literalfallback(theorsplitter 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
orsplitting, so[default: black or white]keeps the full text).
Quotes around parts are stripped when present (e.g., "$HOME/file").
Parameters
spec | The contents captured from [default: ...] (without brackets). |
Returns
A