pub fn replace_vars<F>(input: &str, f: F) -> Result<Cow<'_, str>>where F: Fn(&str) -> Result<String>,
Replaces variables in the form $VAR_NAME with text returned from a function.